[New] Added StringParamBuilder.enumeration()
This commit is contained in:
parent
db8592db41
commit
cf37ef8a2c
|
@ -33,6 +33,12 @@ public class StrolchModelConstants {
|
||||||
|
|
||||||
public static final String SUFFIX_REF = "-Ref";
|
public static final String SUFFIX_REF = "-Ref";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This interpretation value indicates that the value of the {@link Parameter} should be understood as an
|
||||||
|
* enumeration
|
||||||
|
*/
|
||||||
|
public static final String INTERPRETATION_ENUMERATION = "Enumeration"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interpretation value indicates that the value of the {@link Parameter} should be understood as a reference
|
* This interpretation value indicates that the value of the {@link Parameter} should be understood as a reference
|
||||||
* to a {@link Resource}
|
* to a {@link Resource}
|
||||||
|
|
|
@ -31,6 +31,13 @@ public class StringParamBuilder<T extends ParameterBagContainerBuilder<T>>
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public StringParamBuilder<T> enumeration(Enum<?> defaultValue) {
|
||||||
|
this.interpretation = INTERPRETATION_ENUMERATION;
|
||||||
|
this.uom = defaultValue.getDeclaringClass().getSimpleName();
|
||||||
|
value(defaultValue.name());
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StringParameter build() {
|
public StringParameter build() {
|
||||||
return build(new StringParameter());
|
return build(new StringParameter());
|
||||||
|
|
Loading…
Reference in New Issue