public class TypeUtils extends Object
Constructor and Description |
---|
TypeUtils() |
Modifier and Type | Method and Description |
---|---|
static <T extends Comparable<T>> |
compare(T o1,
T o2)
Compare two values to each other.
|
static boolean |
equals(Object v1,
Object v2)
Check if two providence value objects are equal.
|
static boolean |
equalsQualifiedName(PDescriptor a,
PDescriptor b)
Check if the two descriptors has the same qualified name, i..e
symbolically represent the same type.
|
static int |
hashCode(Object object)
Make a type-safe hash code for an object.
|
static int |
hashCode(PField field,
Object object)
Make a typed hashcode for providence message fields.
|
static String |
toString(net.morimekta.util.Binary bytes)
Make a minimal printable string from a binary value.
|
static String |
toString(Collection<?> collection)
Make a printable string from a collection using the tools here.
|
static String |
toString(double d)
Make a minimal printable string from a double value.
|
static String |
toString(Map<?,?> map)
Make a minimal printable string value from a typed map.
|
static String |
toString(Object o)
Make an object into a string using the typed tools here.
|
static String |
toString(PMessage<?> message)
Stringify a message.
|
public static String toString(double d)
d
- The double value.public static String toString(net.morimekta.util.Binary bytes)
bytes
- The binary value.public static String toString(Collection<?> collection)
collection
- The collection to stringify.public static String toString(Map<?,?> map)
map
- The map to stringify.public static String toString(PMessage<?> message)
message
- The message to stringify.public static String toString(Object o)
o
- The object to stringify.public static boolean equals(Object v1, Object v2)
v1
- The first object.v2
- The second object.public static int hashCode(PField field, Object object)
field
- The field descriptor.object
- The field value.public static int hashCode(Object object)
object
- The object to hash.public static boolean equalsQualifiedName(PDescriptor a, PDescriptor b)
a
- The first type.b
- The second type.public static <T extends Comparable<T>> int compare(T o1, T o2)
T
- The object type.o1
- The first value.o2
- The second value.Copyright © 2016. All rights reserved.