Interface Value<V>

    • Method Detail

      • setValue

        Value<V> setValue​(V value)
        Sets the inner value of this.
        Parameters:
        value - the new value
        Returns:
        a reference to this model
      • getValue

        V getValue()
        Returns the inner value of this model.
        Returns:
        the inner value
      • ofArray

        static ArrayValue ofArray()
        Returns a new ArrayValue with no values set.
        Returns:
        an ArrayValue
      • ofArray

        static ArrayValue ofArray​(List<Value<?>> values)
        Returns a new ArrayValue with the specified values set.
        Parameters:
        values - the values to initialize the array with
        Returns:
        an ArrayValue
      • ofBoolean

        static BooleanValue ofBoolean​(Boolean val)
        Returns a new BooleanValue with the specified value.
        Parameters:
        val - the boolean
        Returns:
        the boolean value
      • ofEnum

        static EnumValue ofEnum​(Type type,
                                String constant)
        Returns a new EnumValue with the specified constant selected.
        Parameters:
        type - the enum type
        constant - the selected constant
        Returns:
        the boolean value
      • ofNull

        static NullValue ofNull()
        Returns a new NullValue representing null.
        Returns:
        a NullValue
      • ofNumber

        static NumberValue ofNumber​(Number num)
        Returns a new NumberValue.
        Parameters:
        num - the represented number
        Returns:
        the created number value
      • ofReference

        static ReferenceValue ofReference​(String reference)
        Returns a new ReferenceValue representing a reference to an object.
        Parameters:
        reference - the code to show
        Returns:
        the reference value
      • ofText

        static TextValue ofText​(String text)
        Returns a new TextValue representing a string text.
        Parameters:
        text - the text
        Returns:
        the text value
      • ofAnonymous

        static AnonymousValue ofAnonymous​(Type implementedType)
        Returns a new AnonymousValue representing the anonymous implementation of a class or interface as the value of a field.
        Parameters:
        implementedType - the class or interface to implement
        Returns:
        the anonymous value
      • ofInvocation

        static InvocationValue ofInvocation​(String method,
                                            Value<?>... args)
        Returns a new InvocationValue representing a call to the specified local method with the specified arguments.
        Parameters:
        method - the local method to invoke
        args - the arguments to pass to it
        Returns:
        the created invocation
      • ofInvocation

        static InvocationValue ofInvocation​(Type owner,
                                            String method,
                                            Value<?>... args)
        Returns a new InvocationValue representing a call to the specified static method in the specified class with the specified arguments.
        Parameters:
        owner - the class where the static method is located
        method - the static method to invoke
        args - the arguments to pass to it
        Returns:
        the created invocation