Class JavaFactoryConstant<T>

Type Parameters:
T - type of value.
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
Direct Known Subclasses:
JavaConstantBoolean, JavaConstantByte, JavaConstantCharacter, JavaConstantDouble, JavaConstantFloat, JavaConstantInteger, JavaConstantLong, JavaConstantShort

public abstract class JavaFactoryConstant<T> extends JavaConstant<T>
Implementation of JavaConstant using a standard factory method such as Integer.valueOf(int).
Since:
1.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)
  • Constructor Details

    • JavaFactoryConstant

      public JavaFactoryConstant(T value)
      The constructor.
      Parameters:
      value - the value.
  • Method Details

    • of

      public static JavaConstant<?> of(Object value)
      Parameters:
      value - the literal value.
      Returns:
      the JavaConstant for the given value. May be null if the type of the given value is not supported.