de.team33.patterns.reflect.pandora.Prefix Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of reflect-pandora Show documentation
Show all versions of reflect-pandora Show documentation
Provides tools and utilities for reflective processing of properties.
package de.team33.patterns.reflect.pandora;
import java.util.stream.Stream;
@SuppressWarnings("FieldNamingConvention")
enum Prefix {
is,
get,
set,
NONE(0);
final int length;
Prefix() {
this.length = name().length();
}
Prefix(final int length) {
this.length = length;
}
static Prefix of(final String name) {
return Stream.of(values())
.filter(prefix -> name.startsWith(prefix.name()))
.findAny()
.orElse(NONE);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy