Class NumberConversions

java.lang.Object
org.bukkit.util.NumberConversions

public final class NumberConversions
extends java.lang.Object
Utils for casting number types to other number types
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    private NumberConversions()  
  • Method Summary

    Modifier and Type Method Description
    static int ceil​(double num)  
    static void checkFinite​(double d, @NotNull java.lang.String message)  
    static void checkFinite​(float d, @NotNull java.lang.String message)  
    static int floor​(double num)  
    static boolean isFinite​(double d)  
    static boolean isFinite​(float f)  
    static int round​(double num)  
    static double square​(double num)  
    static byte toByte​(@Nullable java.lang.Object object)  
    static double toDouble​(@Nullable java.lang.Object object)  
    static float toFloat​(@Nullable java.lang.Object object)  
    static int toInt​(@Nullable java.lang.Object object)  
    static long toLong​(@Nullable java.lang.Object object)  
    static short toShort​(@Nullable java.lang.Object object)  

    Methods inherited from class java.lang.Object

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

    • NumberConversions

      private NumberConversions()
  • Method Details

    • floor

      public static int floor​(double num)
    • ceil

      public static int ceil​(double num)
    • round

      public static int round​(double num)
    • square

      public static double square​(double num)
    • toInt

      public static int toInt​(@Nullable @Nullable java.lang.Object object)
    • toFloat

      public static float toFloat​(@Nullable @Nullable java.lang.Object object)
    • toDouble

      public static double toDouble​(@Nullable @Nullable java.lang.Object object)
    • toLong

      public static long toLong​(@Nullable @Nullable java.lang.Object object)
    • toShort

      public static short toShort​(@Nullable @Nullable java.lang.Object object)
    • toByte

      public static byte toByte​(@Nullable @Nullable java.lang.Object object)
    • isFinite

      public static boolean isFinite​(double d)
    • isFinite

      public static boolean isFinite​(float f)
    • checkFinite

      public static void checkFinite​(double d, @NotNull @NotNull java.lang.String message)
    • checkFinite

      public static void checkFinite​(float d, @NotNull @NotNull java.lang.String message)