copyWith method

LightPowerUpColorColorTemperature copyWith({
  1. int? mirek,
  2. bool copyOriginalValues = true,
})

Returns a copy of this object with its field values replaced by the ones provided to this method.

copyOriginalValues is true if you want to maintain the original object's initial values. This is useful if you plan on using this object in a PUT request.

Implementation

LightPowerUpColorColorTemperature copyWith({
  int? mirek,
  bool copyOriginalValues = true,
}) {
  LightPowerUpColorColorTemperature toReturn =
      LightPowerUpColorColorTemperature(
    mirek: copyOriginalValues ? _originalMirek : (mirek ?? this.mirek),
  );

  if (copyOriginalValues) {
    toReturn.mirek = mirek ?? this.mirek;
  }

  return toReturn;
}