Replace tabs with spaces

This commit is contained in:
Eric 2018-08-02 17:08:37 +02:00
parent 71eb53c38f
commit 35e1d50c25
4 changed files with 53 additions and 53 deletions

View File

@ -16,18 +16,18 @@ public class BooleanFlag extends AbstractFlag<Boolean> {
super(name, boolean.class, defaultValue);
}
@Override
public Object serialize(Boolean value) {
return value;
}
@Override
public Object serialize(Boolean value) {
return value;
}
@Override
public Boolean deserialize(Object serialized) {
return (Boolean) serialized;
}
@Override
public Boolean deserialize(Object serialized) {
return (Boolean) serialized;
}
@Override
public Boolean parse(Player player, String userInput) {
@Override
public Boolean parse(Player player, String userInput) {
if (userInput.equalsIgnoreCase("true") || userInput.equalsIgnoreCase("yes")
|| userInput.equalsIgnoreCase("on")
|| userInput.equalsIgnoreCase("1")) {
@ -39,6 +39,6 @@ public class BooleanFlag extends AbstractFlag<Boolean> {
} else {
return null;
}
}
}
}

View File

@ -8,31 +8,31 @@ import org.codemc.worldguardwrapper.implementation.AbstractFlag;
*/
public class DoubleFlag extends AbstractFlag<Double> {
public DoubleFlag(String name) {
this(name, 0d);
}
public DoubleFlag(String name) {
this(name, 0d);
}
public DoubleFlag(String name, double defaultValue) {
super(name, double.class, defaultValue);
}
@Override
public Object serialize(Double value) {
return value;
}
@Override
public Object serialize(Double value) {
return value;
}
@Override
public Double deserialize(Object serialized) {
if (serialized instanceof Number) {
@Override
public Double deserialize(Object serialized) {
if (serialized instanceof Number) {
return ((Number) serialized).doubleValue();
} else {
return null;
}
}
}
@Override
public Double parse(Player player, String userInput) {
return Double.parseDouble(userInput);
}
@Override
public Double parse(Player player, String userInput) {
return Double.parseDouble(userInput);
}
}

View File

@ -8,31 +8,31 @@ import org.codemc.worldguardwrapper.implementation.AbstractFlag;
*/
public class IntegerFlag extends AbstractFlag<Integer> {
public IntegerFlag(String name) {
this(name, 0);
}
public IntegerFlag(String name) {
this(name, 0);
}
public IntegerFlag(String name, int defaultValue) {
super(name, int.class, defaultValue);
}
@Override
public Object serialize(Integer value) {
return value;
}
@Override
public Object serialize(Integer value) {
return value;
}
@Override
public Integer deserialize(Object serialized) {
if (serialized instanceof Number) {
@Override
public Integer deserialize(Object serialized) {
if (serialized instanceof Number) {
return ((Number) serialized).intValue();
} else {
return null;
}
}
}
@Override
public Integer parse(Player player, String userInput) {
return Integer.parseInt(userInput);
}
@Override
public Integer parse(Player player, String userInput) {
return Integer.parseInt(userInput);
}
}

View File

@ -16,19 +16,19 @@ public class StringFlag extends AbstractFlag<String> {
super(name, String.class, defaultValue);
}
@Override
public Object serialize(String value) {
return value;
}
@Override
public Object serialize(String value) {
return value;
}
@Override
public String deserialize(Object serialized) {
return (String) serialized;
}
@Override
public String deserialize(Object serialized) {
return (String) serialized;
}
@Override
public String parse(Player player, String userInput) {
return userInput;
}
@Override
public String parse(Player player, String userInput) {
return userInput;
}
}