Package dev.dokimos.server.dto.v1
Record Class CreateRunRequest
java.lang.Object
java.lang.Record
dev.dokimos.server.dto.v1.CreateRunRequest
-
Constructor Summary
ConstructorsConstructorDescriptionCreateRunRequest(@NotBlank String experimentName, Map<String, Object> metadata, String name, String gitSha, String gitBranch, String triggeredBy, String datasetName, @Min(1L) Integer datasetVersion) Creates an instance of aCreateRunRequestrecord class.CreateRunRequest(String experimentName, Map<String, Object> metadata, String name, String gitSha, String gitBranch, String triggeredBy) Backwards-compatible 6-arg constructor for callers that predate the dataset linkage. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedatasetNamerecord component.@Min(1L) IntegerReturns the value of thedatasetVersionrecord component.final booleanIndicates whether some other object is "equal to" this one.@NotBlank StringReturns the value of theexperimentNamerecord component.Returns the value of thegitBranchrecord component.gitSha()Returns the value of thegitSharecord component.final inthashCode()Returns a hash code value for this object.@jakarta.validation.constraints.AssertTrue(message="datasetName and datasetVersion must be set together") booleanCross-field rule enforcing thatdatasetNameanddatasetVersionare either both supplied or both absent.metadata()Returns the value of themetadatarecord component.name()Returns the value of thenamerecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetriggeredByrecord component.
-
Constructor Details
-
CreateRunRequest
public CreateRunRequest(String experimentName, Map<String, Object> metadata, String name, String gitSha, String gitBranch, String triggeredBy) Backwards-compatible 6-arg constructor for callers that predate the dataset linkage. -
CreateRunRequest
public CreateRunRequest(@NotBlank @NonNull @NotBlank String experimentName, Map<String, Object> metadata, String name, String gitSha, String gitBranch, String triggeredBy, String datasetName, @Min(1L) @Min(1L) Integer datasetVersion) Creates an instance of aCreateRunRequestrecord class.- Parameters:
experimentName- the value for theexperimentNamerecord componentmetadata- the value for themetadatarecord componentname- the value for thenamerecord componentgitSha- the value for thegitSharecord componentgitBranch- the value for thegitBranchrecord componenttriggeredBy- the value for thetriggeredByrecord componentdatasetName- the value for thedatasetNamerecord componentdatasetVersion- the value for thedatasetVersionrecord component
-
-
Method Details
-
isDatasetLinkageValid
@AssertTrue(message="datasetName and datasetVersion must be set together") public @jakarta.validation.constraints.AssertTrue(message="datasetName and datasetVersion must be set together") boolean isDatasetLinkageValid()Cross-field rule enforcing thatdatasetNameanddatasetVersionare either both supplied or both absent. Returningfalsecauses@Validto surface aMethodArgumentNotValidExceptionso the user-facing path returns 400 instead of the 404 that would result from the defensive check in the service. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
experimentName
Returns the value of theexperimentNamerecord component.- Returns:
- the value of the
experimentNamerecord component
-
metadata
Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
gitSha
Returns the value of thegitSharecord component.- Returns:
- the value of the
gitSharecord component
-
gitBranch
Returns the value of thegitBranchrecord component.- Returns:
- the value of the
gitBranchrecord component
-
triggeredBy
Returns the value of thetriggeredByrecord component.- Returns:
- the value of the
triggeredByrecord component
-
datasetName
Returns the value of thedatasetNamerecord component.- Returns:
- the value of the
datasetNamerecord component
-
datasetVersion
Returns the value of thedatasetVersionrecord component.- Returns:
- the value of the
datasetVersionrecord component
-