initial commit
This commit is contained in:
parent
3c9ee26b06
commit
22186c33b9
1458 changed files with 282792 additions and 0 deletions
33
java/src/game/properties/PropertyBool.java
Executable file
33
java/src/game/properties/PropertyBool.java
Executable file
|
@ -0,0 +1,33 @@
|
|||
package game.properties;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import game.collect.ImmutableSet;
|
||||
|
||||
public class PropertyBool extends PropertyHelper<Boolean>
|
||||
{
|
||||
private final ImmutableSet<Boolean> allowedValues = ImmutableSet.<Boolean>of(Boolean.valueOf(true), Boolean.valueOf(false));
|
||||
|
||||
protected PropertyBool(String name)
|
||||
{
|
||||
super(name, Boolean.class);
|
||||
}
|
||||
|
||||
public Collection<Boolean> getAllowedValues()
|
||||
{
|
||||
return this.allowedValues;
|
||||
}
|
||||
|
||||
public static PropertyBool create(String name)
|
||||
{
|
||||
return new PropertyBool(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name for the given value.
|
||||
*/
|
||||
public String getName(Boolean value)
|
||||
{
|
||||
return value.toString();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue