Package de.neo.rankbridge.shared.util
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
-
Constructor Summary
Constructors Constructor Description UniversalType(T object)new Instance. -
Method Summary
Modifier and Type Method Description java.lang.BooleangetAsBoolean()Returns the Object as Boolean.byte[]getAsBytes()Returns the Object as ByteArray.java.lang.DoublegetAsDouble()Returns the Object as Double.java.lang.FloatgetAsFloat()Returns the Object as Float.<V> VgetAsGeneric(java.lang.Class<V> type)Returns the Object as you wish.java.lang.IntegergetAsInteger()Returns the Object as Integer.java.lang.LonggetAsLong()Returns the Object as Long.java.lang.ObjectgetAsObject()Returns the Object as Object.TgetAsOriginal()Returns the Object as Original.java.lang.StringgetAsString()Returns the Object as String.java.lang.Class<T>getObjectClass()Returns the Class of the Object
-
Field Details
-
Constructor Details
-
UniversalType
new Instance.- Parameters:
object- the OriginalObject.
-
-
Method Details
-
getObjectClass
Returns the Class of the Object- Returns:
- the Class of the Object.
-
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.
-