Package net.morimekta.providence
Class PEnumBuilder<T>
- java.lang.Object
-
- net.morimekta.providence.PEnumBuilder<T>
-
- All Implemented Interfaces:
PBuilder<T>
- Direct Known Subclasses:
PApplicationExceptionType._Builder
,PServiceCallType._Builder
public abstract class PEnumBuilder<T> extends java.lang.Object implements PBuilder<T>
A builder-helper for getting a correct enum entity from value or name.
-
-
Constructor Summary
Constructors Constructor Description PEnumBuilder()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract PEnumBuilder<T>
setById(int value)
Set the enum entity from integer value as it was defined in the thrift IDL.abstract PEnumBuilder<T>
setByName(java.lang.String name)
Set the enum entity from name as it was written in the thrift IDL.abstract boolean
valid()
Check if the enum builder has been given a valid value.
-
-
-
Method Detail
-
valid
public abstract boolean valid()
Check if the enum builder has been given a valid value.- Returns:
- True if valid.
-
setById
@Nonnull public abstract PEnumBuilder<T> setById(int value)
Set the enum entity from integer value as it was defined in the thrift IDL.- Parameters:
value
- The value to match.- Returns:
- The builder.
-
setByName
@Nonnull public abstract PEnumBuilder<T> setByName(java.lang.String name)
Set the enum entity from name as it was written in the thrift IDL.- Parameters:
name
- The name to match.- Returns:
- The builder.
-
-