tools.service.metadata.DefaultOperationMetadata Maven / Gradle / Ivy
package tools.service.metadata;
import java.util.Objects;
/**
* Default implementation of {@link IOperationMetadata}. Ensures that both
* serializationKey and description are non-null.
*
* @param serializationKey the key used for serialization purposes
* @param description the description of the operation
*/
public record DefaultOperationMetadata(String serializationKey, String description, boolean recordOperationMeasure)
implements IOperationMetadata {
/**
* Validates that both serializationKey and description are not null.
*/
public DefaultOperationMetadata {
Objects.requireNonNull(serializationKey, "serializationKey must not be null");
Objects.requireNonNull(description, "description must not be null");
}
@Override
public IOperationMetadata getMetadata() {
return this;
}
}