Package 

Class Convert


  • 
    public final class Convert
    
                        

    Provides utility methods to handle type conversions

    • Method Detail

      • toString

        @Nullable() static String toString(@Nullable() Object source, @Nullable() String defaultValue)

        Converts the given object into a String object.

        Parameters:
        source - the object to be converted.
        defaultValue - the value that should be returned if the object cannot be converted.
      • toBoolean

         static boolean toBoolean(@Nullable() Object source)

        Find the boolean value of the source

        Parameters:
        source - the object to be compared.
      • toLong

         static long toLong(@Nullable() Object source, long defaultValue)

        Converts the given object into a primitive long value.

        Parameters:
        source - the object to be converted.
        defaultValue - the value that should be returned if the object cannot be converted.
      • toLong

         static long toLong(@Nullable() Object source)

        Converts the given object into a primitive long value.

        Parameters:
        source - the object to be converted.
      • toInt

         static int toInt(@Nullable() Object source, int defaultValue)

        Converts the given object into a primitive integer value.

        Parameters:
        source - the object to be converted.
        defaultValue - the value that should be returned if the object cannot be converted.
      • toInt

         static int toInt(@Nullable() Object source)

        Converts the given object into a primitive integer value.

        Parameters:
        source - the object to be converted.
      • toSet

        @NonNull() static <T extends Object> Set<T> toSet(@Nullable() Array<T> source)

        Converts the given primitive array of objects into a Set of objects.

        Parameters:
        source - the array of objects to be converted.
      • toList

        @NonNull() static <T extends Object> List<T> toList(@Nullable() Set<T> source)

        Converts a set of objects into a list of objects.

        Parameters:
        source - the set of objects to be converted.
      • toLongArray

        @NonNull() static Array<Long> toLongArray(@Nullable() Array<long> source)

        Converts the give array of primitive long values into an array of Long values.

        Parameters:
        source - an array of primitive long values.