dev.fitko.fitconnect.api.domain.model.route.RouteProcessingDuration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of client Show documentation
Show all versions of client Show documentation
Library that provides client access to the FIT-Connect api-endpoints for sending, subscribing and
routing
The newest version!
package dev.fitko.fitconnect.api.domain.model.route;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class RouteProcessingDuration {
private Integer minDuration;
private Integer maxDuration;
private UnitEnum unit;
public enum UnitEnum {
YEAR("year"),
MONTH("month"),
WEEK("week"),
DAY("day"),
WORKDAY("workday"),
HOUR("hour"),
MINUTE("minute"),
SECOND("second");
private String value;
UnitEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static UnitEnum fromValue(String value) {
for (UnitEnum b : values()) {
if (b.value.equals(value)) {
return b;
}
}
throw new IllegalArgumentException("Unexpected value '" + value + "'");
}
}
}