类 ImmutableObjects

java.lang.Object
org.babyfish.jimmer.ImmutableObjects

public class ImmutableObjects extends Object
  • 方法概要

    修饰符和类型
    方法
    说明
    static <I> I
    fromString(Class<I> type, String json)
    Convert a JSON string to an object.
    static Object
    get(Object immutable, int prop)
    Get the property value of immutable object, if the property is not loaded, exception will be thrown.
    static Object
    get(Object immutable, String prop)
    Get the property value of immutable object, if the property is not loaded, exception will be thrown.
    static Object
    get(Object immutable, ImmutableProp prop)
    Get the property value of immutable object, if the property is not loaded, exception will be thrown.
    static <T, X> X
    get(T immutable, TypedProp<T,X> prop)
    Get the property value of immutable object, if the property is not loaded, exception will be thrown.
    static boolean
    isIdOnly(Object immutable)
     
    static boolean
    isLoaded(Object immutable, int prop)
    Jimmer object is dynamic, none properties are mandatory.
    static boolean
    isLoaded(Object immutable, String prop)
    Jimmer object is dynamic, none properties are mandatory.
    static boolean
    isLoaded(Object immutable, ImmutableProp prop)
    Jimmer object is dynamic, none properties are mandatory.
    static boolean
    isLoaded(Object immutable, TypedProp<?,?> prop)
    Jimmer object is dynamic, none properties are mandatory.
    static boolean
    isLonely(Object immutable)
     
    static String
    toString(Object immutable)
    Convert an object to a JSON string.

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 方法详细资料

    • isLoaded

      public static boolean isLoaded(Object immutable, int prop)
      Jimmer object is dynamic, none properties are mandatory. This method can ask whether a property of the object is specified.
      参数:
      immutable - Object instance
      prop - Property id
      返回:
      Whether the property of the object is specified.
      抛出:
      IllegalArgumentException - The first argument is immutable object created by jimmer
    • isLoaded

      public static boolean isLoaded(Object immutable, String prop)
      Jimmer object is dynamic, none properties are mandatory. This method can ask whether a property of the object is specified.
      参数:
      immutable - Object instance
      prop - Property name
      返回:
      Whether the property of the object is specified.
      抛出:
      IllegalArgumentException - The first argument is immutable object created by jimmer
    • isLoaded

      public static boolean isLoaded(Object immutable, ImmutableProp prop)
      Jimmer object is dynamic, none properties are mandatory. This method can ask whether a property of the object is specified.
      参数:
      immutable - Object instance
      prop - Property
      返回:
      Whether the property of the object is specified.
      抛出:
      IllegalArgumentException - The first argument is immutable object created by jimmer
    • isLoaded

      public static boolean isLoaded(Object immutable, TypedProp<?,?> prop)
      Jimmer object is dynamic, none properties are mandatory. This method can ask whether a property of the object is specified.
      参数:
      immutable - Object instance
      prop - Property
      返回:
      Whether the property of the object is specified.
      抛出:
      IllegalArgumentException - The first argument is immutable object created by jimmer
    • get

      public static Object get(Object immutable, int prop)
      Get the property value of immutable object, if the property is not loaded, exception will be thrown.
      参数:
      immutable - Object instance
      prop - Property id
      返回:
      Whether the property of the object is specified.
      抛出:
      IllegalArgumentException - There are two possibilities
      • The first argument is immutable object created by jimmer
      • The second argument is not a valid property name of immutable object
      UnloadedException - The property is not loaded
    • get

      public static Object get(Object immutable, String prop)
      Get the property value of immutable object, if the property is not loaded, exception will be thrown.
      参数:
      immutable - Object instance
      prop - Property name
      返回:
      Whether the property of the object is specified.
      抛出:
      IllegalArgumentException - There are two possibilities
      • The first argument is immutable object created by jimmer
      • The second argument is not a valid property name of immutable object
      UnloadedException - The property is not loaded
    • get

      public static Object get(Object immutable, ImmutableProp prop)
      Get the property value of immutable object, if the property is not loaded, exception will be thrown.
      参数:
      immutable - Object instance
      prop - Property
      返回:
      Whether the property of the object is specified.
      抛出:
      IllegalArgumentException - There are two possibilities
      • The first argument is immutable object created by jimmer
      • The second argument is not a valid property name of immutable object
      UnloadedException - The property is not loaded
    • get

      public static <T, X> X get(T immutable, TypedProp<T,X> prop)
      Get the property value of immutable object, if the property is not loaded, exception will be thrown.
      类型参数:
      T - The entity type
      X - The property type
      参数:
      immutable - Object instance
      prop - Property
      返回:
      Whether the property of the object is specified.
      抛出:
      IllegalArgumentException - There are two possibilities
      • The first argument is immutable object created by jimmer
      • The second argument is not a valid property name of immutable object
      UnloadedException - The property is not loaded
    • isIdOnly

      public static boolean isIdOnly(Object immutable)
    • isLonely

      public static boolean isLonely(Object immutable)
    • toString

      public static String toString(Object immutable)
      Convert an object to a JSON string. If the object is jimmer immutable object, unspecified properties can be automatically ignored.
      参数:
      immutable - Any object
      返回:
      JSON string
    • fromString

      public static <I> I fromString(Class<I> type, String json) throws com.fasterxml.jackson.core.JsonProcessingException
      Convert a JSON string to an object.
      参数:
      type - Object type, can be interface type.
      返回:
      Deserialized object
      抛出:
      com.fasterxml.jackson.core.JsonProcessingException