Package org.eolang

Class Param


  • public final class Param
    extends Object
    Param of an object (convenient retrieval mechanism).

    The job of the utility object is to help our EO objects retrieve attributes from other objects and from their own \rho (owners). On top of retrieval, this object also does simple type checking. When an attribute is expected to be of some type, we use strong(Class). This method will throw a runtime exception if types don't match.

    Since:
    0.20
    • Constructor Detail

      • Param

        public Param​(Phi obj)
        Ctor.
        Parameters:
        obj - The object to fetch \rho from
      • Param

        public Param​(Phi obj,
                     String name)
        Ctor.
        Parameters:
        obj - The object to fetch the attribute from
        name - Name of the attr
    • Method Detail

      • strong

        public <T> T strong​(Class<T> type)
        Fetch and check type.
        Type Parameters:
        T - The type
        Parameters:
        type - The type
        Returns:
        The object
      • asBytes

        public Bytes asBytes()
        Fetch BYTES of any type.
        Returns:
        Bytes.