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 stringDuration.UnitEnumgetUnit()The unit of time.IntegergetValue()The length of time by the unit.inthashCode()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)Durationvalue(Integer value)
-
-
-
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)
-
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
-
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-
-
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
-
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-
-
equals
public boolean equals(Object o)
Return true if this Duration object is equal to o.
-
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
-
-