io.github.nichetoolkit.rest.RestField Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rest-toolkit-core Show documentation
Show all versions of rest-toolkit-core Show documentation
Rest toolkit core project for Spring Boot
package io.github.nichetoolkit.rest;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* RestField
* @author Cyan ([email protected])
* @version v1.0.0
*/
public interface RestField extends RestValue {
String getField();
static T parserField(Class clazz, String field) {
if (field != null && clazz.isEnum()) {
Map valueEnumMap =Stream.of(clazz.getEnumConstants()).collect(Collectors.toMap(RestField::getField, Function.identity()));
return valueEnumMap.get(field);
} else {
return null;
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy