final class RecordOps[L <: HList] extends AnyVal with Serializable
Record operations on HList
's with field-like elements.
- Alphabetic
- By Inheritance
- RecordOps
- Serializable
- Serializable
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new RecordOps(l: L)
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- Any
-
final
def
##(): Int
- Definition Classes
- Any
-
def
+[F](f: F)(implicit updater: Updater[L, F]): Out
Updates or adds to this record a field of type F.
-
def
-[V, Out <: HList](k: Witness)(implicit remover: ops.record.Remover.Aux[L, T, (V, Out)]): Out
Remove the field associated with the singleton typed key k, returning the updated record.
Remove the field associated with the singleton typed key k, returning the updated record. Only available if this record has a field with keyType equal to the singleton type k.T.
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- Any
-
def
alignByKeys[K <: HList](implicit alignByKeys: AlignByKeys[L, K]): Out
Align the keys on the order of HList of keys K
-
def
apply(k: Witness)(implicit selector: Selector[L, T]): Out
Returns the value associated with the singleton typed key k.
Returns the value associated with the singleton typed key k. Only available if this record has a field with with keyType equal to the singleton type k.T.
Note that this can creates a bogus ambiguity with
HListOps#apply
as described in https://issues.scala-lang.org/browse/SI-5142. If this method is accessible the conflict can be worked around by using HListOps#at instead ofHListOps#apply
. -
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
deepMerge[M <: HList](m: M)(implicit merger: DeepMerger[L, M]): Out
Returns the deep union of this record and another record.
-
def
extract[E <: HList](implicit extractor: Extractor[L, E]): E
Extracts super-record from sub-record according to depth subtype relation
-
def
fieldAt(k: Witness)(implicit selector: Selector[L, T]): FieldType[T, Out]
Returns the value associated with the singleton typed key k.
Returns the value associated with the singleton typed key k. Only available if this record has a field with with keyType equal to the singleton type k.T.
-
def
fields(implicit fields: Fields[L]): Out
Returns a
HList
made of the key-value pairs of this record. -
def
get(k: Witness)(implicit selector: Selector[L, T]): Out
Returns the value associated with the singleton typed key k.
Returns the value associated with the singleton typed key k. Only available if this record has a field with with keyType equal to the singleton type k.T.
-
def
getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
keys(implicit keys: Keys[L]): Out
Returns the keys of this record as an
HList
of singleton typed values. - val l: L
-
def
mapValues(f: Poly)(implicit mapValues: MapValues[f.type, L]): Out
Maps a higher rank function across the values of this record.
-
def
merge[M <: HList](m: M)(implicit merger: Merger[L, M]): Out
Returns the union of this record and another record.
-
def
mergeWith[M <: HList](m: M)(f: Poly)(implicit merger: MergeWith[L, M, f.type]): Out
Returns the union of this record and another record using the provided
f
to combine the values of fields which are present in both.Returns the union of this record and another record using the provided
f
to combine the values of fields which are present in both.The duplicated fields will be merged with
f
. -
def
record: DynamicRecordOps[L]
Returns a wrapped version of this record that provides
selectDynamic
access to fields. -
def
remove(k: Witness)(implicit remover: Remover[L, T]): ops.record.Remover.Out
Remove the field associated with the singleton typed key k, returning both the corresponding value and the updated record.
Remove the field associated with the singleton typed key k, returning both the corresponding value and the updated record. Only available if this record has a field with keyType equal to the singleton type k.T.
-
def
renameField(oldKey: Witness, newKey: Witness)(implicit renamer: Renamer[L, T, T]): Out
Rename the field associated with the singleton typed key oldKey.
Rename the field associated with the singleton typed key oldKey. Only available if this record has a field with keyType equal to the singleton type oldKey.T.
-
def
replace[V](k: Witness, v: V)(implicit ev: Aux[L, T, V], updater: Updater[L, FieldType[T, V]]): Out
Replaces the value of field k with a value of the same type.
Replaces the value of field k with a value of the same type. Only available if this record has a field with keyType equal to the singleton type k.T and valueType equal to V.
-
def
toMap[K, V](implicit toMap: Aux[L, K, V]): Map[K, V]
Returns a
Map
whose keys and values are typed as the Lub of the keys and values of this record. -
def
toString(): String
- Definition Classes
- Any
-
def
updateWith[W](k: WitnessWith[FSL])(f: (Out) ⇒ W)(implicit modifier: Modifier[L, WitnessWith.T, Out, W]): Out
Updates a field having a value with type A by given function.
-
def
updated[V](k: Witness, v: V)(implicit updater: Updater[L, FieldType[T, V]]): Out
Updates or adds to this record a field with key k.
Updates or adds to this record a field with key k. The new field has a value of type V. Only available if this record has a field with keyType equal to the singleton type k.T.
-
def
values(implicit values: Values[L]): Out
Returns a
HList
of the values of this record.