ml.comet.experiment.impl.asset.AssetImpl Maven / Gradle / Ivy
package ml.comet.experiment.impl.asset;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import ml.comet.experiment.asset.Asset;
import ml.comet.experiment.context.ExperimentContext;
import java.io.File;
import java.util.Collections;
import java.util.Map;
import java.util.Optional;
/**
* Describes asset data.
*/
@ToString(onlyExplicitlyIncluded = true)
public class AssetImpl implements Asset {
@ToString.Include
@Getter
@Setter
private File rawFile;
@Getter
@Setter
private byte[] rawFileLikeData;
@Getter
@Setter
private String fileExtension;
@ToString.Include
@Setter
String logicalPath;
@ToString.Include
@Setter
String type;
@ToString.Include
@Getter
@Setter
Boolean overwrite;
@Setter
String groupingName;
@Getter
ExperimentContext context;
@Setter
Map metadata;
public void setContext(ExperimentContext context) {
this.context = new ExperimentContext(context);
}
@Override
public Map getMetadata() {
if (this.metadata != null) {
return this.metadata;
}
return Collections.emptyMap();
}
@Override
public Optional getFile() {
return Optional.ofNullable(this.rawFile);
}
@Override
public Optional getFileLikeData() {
return Optional.ofNullable(this.rawFileLikeData);
}
@Override
public Optional getExperimentContext() {
return Optional.ofNullable(this.context);
}
@Override
public String getLogicalPath() {
return this.logicalPath;
}
@Override
public String getType() {
return this.type;
}
public Optional getGroupingName() {
return Optional.ofNullable(this.groupingName);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy