java.lang.Object
org.monospark.remix.Records
public final class Records extends Object
-
Method Summary
Modifier and Type Method Description static <R extends Record, T1>
RecordBinder<R,T1>bind(Function<R,T1> t1)static <R extends Record, T1>
RecordBinder<R,T1>bind(LambdaSupport.WrappedFunction<R,T1> t1)static <R extends Record, T extends R>
RecordBuilder<T>builder(Class<R> clazz)static <R extends Record, T extends R>
RecordBuilder<T>builder(RecordBlank<T> blank)static <R extends Record>
Rcopy(R src)static <T extends R, R extends Record>
Tcreate(Class<R> clazz, Object... args)Creates a new record instance using the given arguments.static <T extends R, R extends Record>
TcreateRaw(Class<T> clazz, Object... args)Creates a new record instance using the given arguments.static <T extends R, R extends Record>
TfromArray(Class<R> clazz, Object[] values)static booleanget(BooleanSupplier component)static intget(IntSupplier component)static <T> Tget(Supplier<T> component)static booleanget(LambdaSupport.WrappedBooleanSupplier component)static intget(LambdaSupport.WrappedIntSupplier component)static <T> Tget(LambdaSupport.WrappedSupplier<T> component)static <T extends R, R extends Record>
voidremix(Class<R> src, RecordRemixer<T> rm)static <R extends Record>
SerializedRecordserialized(R obj)static voidset(LambdaSupport.MutableBooleanSupplier component, boolean value)static voidset(LambdaSupport.MutableIntSupplier component, int value)static <T> voidset(LambdaSupport.MutableSupplier<T> component, T value)static <T extends D, D extends Record, S extends Record>
TstructuralCopy(Class<D> destClass, S src)static <R extends Record>
Object[]toArray(R src)
-
Method Details
-
builder
-
builder
-
create
Creates a new record instance using the given arguments. This method validates all arguments, automatically wraps arguments if needed and performs operations specified byRecordRemix.assign(Consumer).- Parameters:
clazz- the record classargs- the constructor arguments- Returns:
- a new instance of the record class
- Throws:
NullPointerException- ifclazzorargsis nullIllegalArgumentException- ifclazzis not a record classRemixException- if an instance could not be constructed for any reason
-
createRaw
Creates a new record instance using the given arguments. This method does not perform validation and does not perform operations specified byRecordRemix.assign(Consumer). However, it automatically wraps arguments if needed.- Parameters:
clazz- the record classargs- the constructor arguments- Returns:
- a new instance of the record class
- Throws:
NullPointerException- ifclazzorargsis nullIllegalArgumentException- ifclazzis not a record classRemixException- if an instance could not be constructed for any reason
-
fromArray
-
toArray
-
remix
-
serialized
-
copy
-
structuralCopy
-
get
-
get
-
get
-
get
-
get
-
get
-
set
-
set
-
set
-
bind
-
bind
public static <R extends Record, T1> RecordBinder<R,T1> bind(LambdaSupport.WrappedFunction<R,T1> t1)
-