Class UniversalType<T>

java.lang.Object
de.neo.rankbridge.shared.util.UniversalType<T>
Type Parameters:
T - The OriginalType

public class UniversalType<T>
extends java.lang.Object
UniversalType could be anything.
Version:
1.0
Author:
Neo8
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private T object  
  • Constructor Summary

    Constructors 
    Constructor Description
    UniversalType​(T object)
    new Instance.
  • Method Summary

    Modifier and Type Method Description
    java.lang.Boolean getAsBoolean()
    Returns the Object as Boolean.
    byte[] getAsBytes()
    Returns the Object as ByteArray.
    java.lang.Double getAsDouble()
    Returns the Object as Double.
    java.lang.Float getAsFloat()
    Returns the Object as Float.
    <V> V getAsGeneric​(java.lang.Class<V> type)
    Returns the Object as you wish.
    java.lang.Integer getAsInteger()
    Returns the Object as Integer.
    java.lang.Long getAsLong()
    Returns the Object as Long.
    java.lang.Object getAsObject()
    Returns the Object as Object.
    T getAsOriginal()
    Returns the Object as Original.
    java.lang.String getAsString()
    Returns the Object as String.
    java.lang.Class<T> getObjectClass()
    Returns the Class of the Object

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • UniversalType

      public UniversalType​(T object)
      new Instance.
      Parameters:
      object - the OriginalObject.
  • Method Details

    • getObjectClass

      public java.lang.Class<T> getObjectClass()
      Returns the Class of the Object
      Returns:
      the Class of the Object.
    • getAsOriginal

      public T getAsOriginal()
      Returns the Object as Original.
      Returns:
      the Original.
    • getAsObject

      public java.lang.Object getAsObject()
      Returns the Object as Object.
      Returns:
      the Object.
    • getAsString

      public java.lang.String getAsString()
      Returns the Object as String.
      Returns:
      the String.
    • getAsBytes

      public byte[] getAsBytes()
      Returns the Object as ByteArray.
      Returns:
      the ByteArray.
    • getAsBoolean

      public java.lang.Boolean getAsBoolean()
      Returns the Object as Boolean.
      Returns:
      the Boolean.
    • getAsInteger

      public java.lang.Integer getAsInteger()
      Returns the Object as Integer.
      Returns:
      the Integer.
    • getAsDouble

      public java.lang.Double getAsDouble()
      Returns the Object as Double.
      Returns:
      the Double.
    • getAsLong

      public java.lang.Long getAsLong()
      Returns the Object as Long.
      Returns:
      the Long.
    • getAsFloat

      public java.lang.Float getAsFloat()
      Returns the Object as Float.
      Returns:
      the Float.
    • getAsGeneric

      public <V> V getAsGeneric​(java.lang.Class<V> type)
      Returns the Object as you wish.
      Type Parameters:
      V - the type of the object.
      Parameters:
      type - the type to get the original.
      Returns:
      the object as you wish.