Class JavaEnumConstant<T extends Enum<T>>
java.lang.Object
io.github.mmm.code.base.item.BaseItem
io.github.mmm.code.base.expression.BaseExpression
io.github.mmm.code.impl.java.expression.constant.JavaConstant<T>
io.github.mmm.code.impl.java.expression.constant.JavaEnumConstant<T>
- All Implemented Interfaces:
io.github.mmm.code.api.expression.CodeConstant,io.github.mmm.code.api.expression.CodeExpression,io.github.mmm.code.api.item.CodeItem,JavaExpression
Implementation of
JavaConstant for an Enum value.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
Field Summary
Fields inherited from class io.github.mmm.code.impl.java.expression.constant.JavaConstant
valueFields inherited from interface io.github.mmm.code.api.item.CodeItem
DEFAULT_INDENT, DEFAULT_NEWLINE -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Enum<T>>
JavaEnumConstant<T> of(T value, boolean unqualified) Methods inherited from class io.github.mmm.code.impl.java.expression.constant.JavaConstant
doWrite, evaluate, getJavaClass, getValue, isPrimitive, of, ofMethods inherited from class io.github.mmm.code.base.item.BaseItem
getOwningType, getSpaces, toString, writeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.mmm.code.api.item.CodeItem
getLanguage, write, write, write, write, write, write
-
Method Details
-
getSourceCode
- Specified by:
getSourceCodein interfaceio.github.mmm.code.api.item.CodeItem- Specified by:
getSourceCodein classJavaConstant<T extends Enum<T>>
-
withValue
- Specified by:
withValuein classJavaConstant<T extends Enum<T>>- Parameters:
newValue- the newvalue. May not benull.- Returns:
- the corresponding
JavaConstantof the same type with the given value.
-
of
- Type Parameters:
T- type of theEnumvalue.- Parameters:
value- the constant value.unqualified- -trueto use thesimple name,falseotherwise (forqualified name).- Returns:
- the
JavaConstantfor the givenvalue.
-