Package org.opennms.web.svclayer.model
Class RelativeTimePeriod
- java.lang.Object
-
- org.opennms.web.svclayer.model.RelativeTimePeriod
-
public class RelativeTimePeriod extends Object
RelativeTimePeriod class.
- Since:
- 1.8.1
- Version:
- $Id: $
- Author:
- ranger
-
-
Field Summary
Fields Modifier and Type Field Description static RelativeTimePeriod
DEFAULT_RELATIVE_TIME_PERIOD
-
Constructor Summary
Constructors Constructor Description RelativeTimePeriod()
Constructor for RelativeTimePeriod.RelativeTimePeriod(String id, String name, int offsetField, int offsetAmount)
Constructor for RelativeTimePeriod.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RelativeTimePeriod[]
getDefaultPeriods()
getDefaultPeriodsString
getId()
getIdString
getName()
getNameint
getOffsetAmount()
getOffsetAmountint
getOffsetField()
getOffsetFieldstatic RelativeTimePeriod
getPeriodByIdOrDefault(String id)
getPeriodByIdOrDefaultstatic RelativeTimePeriod
getPeriodByIdOrDefault(RelativeTimePeriod[] periods, String id, RelativeTimePeriod defaultPeriod)
getPeriodByIdOrDefaultlong[]
getStartAndEndTimes()
getStartAndEndTimesvoid
setId(String id)
setIdvoid
setName(String name)
setNamevoid
setOffsetAmount(int offsetAmount)
setOffsetAmountvoid
setOffsetField(int offsetField)
setOffsetField
-
-
-
Field Detail
-
DEFAULT_RELATIVE_TIME_PERIOD
public static final RelativeTimePeriod DEFAULT_RELATIVE_TIME_PERIOD
-
-
Method Detail
-
getOffsetField
public int getOffsetField()
getOffsetField
- Returns:
- a int.
-
setOffsetField
public void setOffsetField(int offsetField)
setOffsetField
- Parameters:
offsetField
- a int.
-
getOffsetAmount
public int getOffsetAmount()
getOffsetAmount
- Returns:
- a int.
-
setOffsetAmount
public void setOffsetAmount(int offsetAmount)
setOffsetAmount
- Parameters:
offsetAmount
- a int.
-
getDefaultPeriods
public static RelativeTimePeriod[] getDefaultPeriods()
getDefaultPeriods
- Returns:
- an array of
RelativeTimePeriod
objects.
-
getPeriodByIdOrDefault
public static RelativeTimePeriod getPeriodByIdOrDefault(String id)
getPeriodByIdOrDefault
- Parameters:
id
- aString
object.- Returns:
- a
RelativeTimePeriod
object.
-
getPeriodByIdOrDefault
public static RelativeTimePeriod getPeriodByIdOrDefault(RelativeTimePeriod[] periods, String id, RelativeTimePeriod defaultPeriod)
getPeriodByIdOrDefault
- Parameters:
periods
- an array ofRelativeTimePeriod
objects.id
- aString
object.defaultPeriod
- aRelativeTimePeriod
object.- Returns:
- a
RelativeTimePeriod
object.
-
getStartAndEndTimes
public long[] getStartAndEndTimes()
getStartAndEndTimes
- Returns:
- an array of long.
-
-