Answers for "java check if property exists in class"

0

java check if property exists in class

public boolean doesObjectContainField(Object object, String fieldName) {
    return Arrays.stream(object.getClass().getFields())
            .anyMatch(f -> f.getName().equals(fieldName));
}
Posted by: Guest on May-01-2021

Code answers related to "java check if property exists in class"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language