com.targomo.client.api.enums.PolygonIntersectionMode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-client Show documentation
Show all versions of java-client Show documentation
Java client library for easy usage of Targomo web services.
The newest version!
/**
*
*/
package com.targomo.client.api.enums;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.stream.Stream;
/**
* @author Daniel Gerber
*
*/
public enum PolygonIntersectionMode {
AVERAGE("average"),
UNION("union"),
INTERSECTION("intersection");
private String key;
PolygonIntersectionMode(String key) {
this.key = key;
}
@JsonCreator
public static PolygonIntersectionMode fromString(String key) {
return key == null ? null : Stream.of(PolygonIntersectionMode.values())
.filter( enu -> enu.key.equalsIgnoreCase(key)).findFirst()
.orElseThrow(() -> new IllegalArgumentException("Invalid " +
PolygonIntersectionMode.class.getSimpleName() + " specified: " + key + " doesn't exist"));
}
@JsonValue
public String getKey() {
return key;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy