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.CustomTypeAdapterFactorystatic classDuration.UnitEnumThe unit of time.
-
Field Summary
Fields Modifier and Type Field Description static HashSet<String>openapiFieldsstatic HashSet<String>openapiRequiredFieldsstatic StringSERIALIZED_NAME_UNITstatic StringSERIALIZED_NAME_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)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)voidsetValue(Integer value)StringtoJson()Convert an instance of Duration to an JSON stringStringtoString()Durationunit(Duration.UnitEnum unit)static voidvalidateJsonObject(com.google.gson.JsonObject jsonObj)static voidvalidateJsonObject(com.google.gson.JsonObject jsonObj, boolean strictValidation)Validates the JSON Object and throws an exception if issues foundDurationvalue(Integer value)
-
-
-
Field Detail
-
SERIALIZED_NAME_UNIT
public static final String SERIALIZED_NAME_UNIT
- See Also:
- Constant Field Values
-
SERIALIZED_NAME_VALUE
public static final String SERIALIZED_NAME_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)
-
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)
-
validateJsonObject
public static void validateJsonObject(com.google.gson.JsonObject jsonObj) throws IOException- Throws:
IOException
-
validateJsonObject
public static void validateJsonObject(com.google.gson.JsonObject jsonObj, boolean strictValidation) throws IOExceptionValidates the JSON Object and throws an exception if issues found- Parameters:
jsonObj- JSON ObjectstrictValidation- reject (new) fields missing from the specifications- Throws:
IOException- if the JSON Object is invalid with respect to Duration
-
fromJson
public static Duration fromJson(String jsonString) throws IOException
Create an instance of Duration given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of Duration
- Throws:
IOException- if the JSON string is invalid with respect to Duration
-
toJson
public String toJson()
Convert an instance of Duration to an JSON string- Returns:
- JSON string
-
-