Package com.adyen.model.balanceplatform
Class Duration
- java.lang.Object
-
- com.adyen.model.balanceplatform.Duration
-
public class Duration extends Object
Duration
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDuration.UnitEnumThe unit of time.
-
Field Summary
Fields Modifier and Type Field Description static StringJSON_PROPERTY_UNITstatic StringJSON_PROPERTY_VALUE
-
Constructor Summary
Constructors Constructor Description Duration()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Return true if this Duration object is equal to o.static DurationfromJson(String jsonString)Create an instance of Duration given an JSON stringMap<String,Object>getExplicitNulls()Returns a map of properties to be merged into the JSON payload as explicit null values.Duration.UnitEnumgetUnit()The unit of time.IntegergetValue()The length of time by the unit.inthashCode()DurationincludeNullValues(boolean includeNullValues)Configures whether null values are explicitly serialized in the JSON payload.booleanisIncludeNullValues()Returns whether null values are explicitly serialized in the JSON payload.voidsetIncludeNullValues(boolean includeNullValues)Sets whether null values should be explicitly serialized in the JSON payload.voidsetUnit(Duration.UnitEnum unit)The unit of time.voidsetValue(Integer value)The length of time by the unit.StringtoJson()Convert an instance of Duration to an JSON stringStringtoString()Durationunit(Duration.UnitEnum unit)The unit of time.Durationvalue(Integer value)The length of time by the unit.
-
-
-
Field Detail
-
JSON_PROPERTY_UNIT
public static final String JSON_PROPERTY_UNIT
- See Also:
- Constant Field Values
-
JSON_PROPERTY_VALUE
public static final String JSON_PROPERTY_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
unit
public Duration unit(Duration.UnitEnum unit)
The unit of time. You can only use **minutes** and **hours** if the `interval.type` is **sliding**. Possible values: **minutes**, **hours**, **days**, **weeks**, or **months**- Parameters:
unit- The unit of time. You can only use **minutes** and **hours** if the `interval.type` is **sliding**. Possible values: **minutes**, **hours**, **days**, **weeks**, or **months**- Returns:
- the current
Durationinstance, allowing for method chaining
-
getUnit
public Duration.UnitEnum getUnit()
The unit of time. You can only use **minutes** and **hours** if the `interval.type` is **sliding**. Possible values: **minutes**, **hours**, **days**, **weeks**, or **months**- Returns:
- unit The unit of time. You can only use **minutes** and **hours** if the `interval.type` is **sliding**. Possible values: **minutes**, **hours**, **days**, **weeks**, or **months**
-
setUnit
public void setUnit(Duration.UnitEnum unit)
The unit of time. You can only use **minutes** and **hours** if the `interval.type` is **sliding**. Possible values: **minutes**, **hours**, **days**, **weeks**, or **months**- Parameters:
unit- The unit of time. You can only use **minutes** and **hours** if the `interval.type` is **sliding**. Possible values: **minutes**, **hours**, **days**, **weeks**, or **months**
-
value
public Duration value(Integer value)
The length of time by the unit. For example, 5 days. The maximum duration is 90 days or an equivalent in other units. For example, 3 months.- Parameters:
value- The length of time by the unit. For example, 5 days. The maximum duration is 90 days or an equivalent in other units. For example, 3 months.- Returns:
- the current
Durationinstance, allowing for method chaining
-
getValue
public Integer getValue()
The length of time by the unit. For example, 5 days. The maximum duration is 90 days or an equivalent in other units. For example, 3 months.- Returns:
- value The length of time by the unit. For example, 5 days. The maximum duration is 90 days or an equivalent in other units. For example, 3 months.
-
setValue
public void setValue(Integer value)
The length of time by the unit. For example, 5 days. The maximum duration is 90 days or an equivalent in other units. For example, 3 months.- Parameters:
value- The length of time by the unit. For example, 5 days. The maximum duration is 90 days or an equivalent in other units. For example, 3 months.
-
includeNullValues
public Duration includeNullValues(boolean includeNullValues)
Configures whether null values are explicitly serialized in the JSON payload. Default is false.
-
isIncludeNullValues
public boolean isIncludeNullValues()
Returns whether null values are explicitly serialized in the JSON payload.
-
setIncludeNullValues
public void setIncludeNullValues(boolean includeNullValues)
Sets whether null values should be explicitly serialized in the JSON payload. Default is false.
-
equals
public boolean equals(Object o)
Return true if this Duration object is equal to o.
-
getExplicitNulls
public Map<String,Object> getExplicitNulls()
Returns a map of properties to be merged into the JSON payload as explicit null values.
-
fromJson
public static Duration fromJson(String jsonString) throws com.fasterxml.jackson.core.JsonProcessingException
Create an instance of Duration given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of Duration
- Throws:
com.fasterxml.jackson.core.JsonProcessingException- if the JSON string is invalid with respect to Duration
-
toJson
public String toJson() throws com.fasterxml.jackson.core.JsonProcessingException
Convert an instance of Duration to an JSON string- Returns:
- JSON string
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
-