[New] StrolchValueType has methods .isBoolean(), isNumber, isString()
This commit is contained in:
parent
acf3c12313
commit
9cc7ed72b0
|
@ -68,6 +68,11 @@ public enum StrolchValueType {
|
||||||
public IValue<?> valueInstance(String valueAsString) {
|
public IValue<?> valueInstance(String valueAsString) {
|
||||||
return new BooleanValue(valueAsString);
|
return new BooleanValue(valueAsString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBoolean() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -94,6 +99,11 @@ public enum StrolchValueType {
|
||||||
public IValue<?> valueInstance(String valueAsString) {
|
public IValue<?> valueInstance(String valueAsString) {
|
||||||
return new IntegerValue(valueAsString);
|
return new IntegerValue(valueAsString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNumber() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -120,6 +130,11 @@ public enum StrolchValueType {
|
||||||
public IValue<?> valueInstance(String valueAsString) {
|
public IValue<?> valueInstance(String valueAsString) {
|
||||||
return new FloatValue(valueAsString);
|
return new FloatValue(valueAsString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNumber() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -136,14 +151,19 @@ public enum StrolchValueType {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StrolchTimedState<? extends IValue<?>> timedStateInstance() {
|
public StrolchTimedState<? extends IValue<?>> timedStateInstance() {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"TimeStates of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("TimeStates of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IValue<?> valueInstance(String valueAsString) {
|
public IValue<?> valueInstance(String valueAsString) {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"Parameters of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("Parameters of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNumber() {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -161,14 +181,19 @@ public enum StrolchValueType {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StrolchTimedState<? extends IValue<?>> timedStateInstance() {
|
public StrolchTimedState<? extends IValue<?>> timedStateInstance() {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"TimeStates of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("TimeStates of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IValue<?> valueInstance(String valueAsString) {
|
public IValue<?> valueInstance(String valueAsString) {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"Parameters of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("Parameters of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isString() {
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -186,14 +211,14 @@ public enum StrolchValueType {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StrolchTimedState<? extends IValue<?>> timedStateInstance() {
|
public StrolchTimedState<? extends IValue<?>> timedStateInstance() {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"TimeStates of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("TimeStates of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IValue<?> valueInstance(String valueAsString) {
|
public IValue<?> valueInstance(String valueAsString) {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"Parameters of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("Parameters of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -211,14 +236,14 @@ public enum StrolchValueType {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StrolchTimedState<? extends IValue<?>> timedStateInstance() {
|
public StrolchTimedState<? extends IValue<?>> timedStateInstance() {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"TimeStates of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("TimeStates of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IValue<?> valueInstance(String valueAsString) {
|
public IValue<?> valueInstance(String valueAsString) {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"Parameters of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("Parameters of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -236,14 +261,14 @@ public enum StrolchValueType {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StrolchTimedState<? extends IValue<?>> timedStateInstance() {
|
public StrolchTimedState<? extends IValue<?>> timedStateInstance() {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"TimeStates of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("TimeStates of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IValue<?> valueInstance(String valueAsString) {
|
public IValue<?> valueInstance(String valueAsString) {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"Parameters of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("Parameters of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -261,14 +286,14 @@ public enum StrolchValueType {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StrolchTimedState<? extends IValue<?>> timedStateInstance() {
|
public StrolchTimedState<? extends IValue<?>> timedStateInstance() {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"TimeStates of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("TimeStates of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IValue<?> valueInstance(String valueAsString) {
|
public IValue<?> valueInstance(String valueAsString) {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"Parameters of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("Parameters of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -286,14 +311,14 @@ public enum StrolchValueType {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StrolchTimedState<? extends IValue<?>> timedStateInstance() {
|
public StrolchTimedState<? extends IValue<?>> timedStateInstance() {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"TimeStates of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("TimeStates of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IValue<?> valueInstance(String valueAsString) {
|
public IValue<?> valueInstance(String valueAsString) {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"Parameters of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("Parameters of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -311,14 +336,14 @@ public enum StrolchValueType {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StrolchTimedState<? extends IValue<?>> timedStateInstance() {
|
public StrolchTimedState<? extends IValue<?>> timedStateInstance() {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"TimeStates of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("TimeStates of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IValue<?> valueInstance(String valueAsString) {
|
public IValue<?> valueInstance(String valueAsString) {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"Values of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("Values of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -333,8 +358,8 @@ public enum StrolchValueType {
|
||||||
STRING_SET("StringSet") {
|
STRING_SET("StringSet") {
|
||||||
@Override
|
@Override
|
||||||
public Parameter<?> parameterInstance() {
|
public Parameter<?> parameterInstance() {
|
||||||
throw new UnsupportedOperationException(MessageFormat.format(
|
throw new UnsupportedOperationException(
|
||||||
"Parameters of type {0} are not supported!", getType())); //$NON-NLS-1$
|
MessageFormat.format("Parameters of type {0} are not supported!", getType())); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -375,4 +400,16 @@ public enum StrolchValueType {
|
||||||
public abstract StrolchTimedState<? extends IValue<?>> timedStateInstance();
|
public abstract StrolchTimedState<? extends IValue<?>> timedStateInstance();
|
||||||
|
|
||||||
public abstract IValue<?> valueInstance(String valueAsString);
|
public abstract IValue<?> valueInstance(String valueAsString);
|
||||||
|
|
||||||
|
public boolean isNumber() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isBoolean() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isString() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue