Package io.github.astrapi69.model
Class BaseModel<T>
- java.lang.Object
-
- io.github.astrapi69.model.GenericModel<T>
-
- io.github.astrapi69.model.BaseModel<T>
-
- Type Parameters:
T
- the generic type of the model object
- All Implemented Interfaces:
Attachable
,IDetachable
,IModel<T>
,IObjectClassAwareModel<T>
,java.io.Serializable
public class BaseModel<T> extends GenericModel<T>
The classBaseModel
for simple objects.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> IModel<T>
of()
Factory methods for IModel which uses type inference to make code shorter.static <T> IModel<T>
of(IModel<?> model)
Supresses generics warning when converting model types.static <T> IModel<T>
of(T object)
Factory methods for IModel which uses type inference to make code shorter.-
Methods inherited from class io.github.astrapi69.model.GenericModel
attach, canEqual, detach, equals, getObject, getObjectClass, hashCode, ofCollection, ofList, ofMap, ofSet, setObject, toString
-
-
-
-
Constructor Detail
-
BaseModel
public BaseModel(T object)
Instantiates a new base model.- Parameters:
object
- the object
-
BaseModel
public BaseModel()
-
-
Method Detail
-
of
public static <T> IModel<T> of()
Factory methods for IModel which uses type inference to make code shorter. Equivalent tonew BaseModel<TypeOfObject>()
.- Type Parameters:
T
- the generic type- Returns:
- IModel that contains
object
-
of
public static <T> IModel<T> of(IModel<?> model)
Supresses generics warning when converting model types.- Type Parameters:
T
- the generic type- Parameters:
model
- the model- Returns:
model
-
of
public static <T> IModel<T> of(T object)
Factory methods for IModel which uses type inference to make code shorter. Equivalent tonew BaseModel<TypeOfObject>(object)
.- Type Parameters:
T
- the generic type- Parameters:
object
- the object- Returns:
- IModel that contains
object
-
-