Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
As this class is immutable, the constructor requires all the member variables to be presented
* for an instance of this object to be created.
*
* The class has methods to retrieve the readable text describing the transformation, and
* relations to retrieve all the associations of source to targets
*
* @see Lineage
* @see Relation
* @see Many
*/
@Beta
public final class Mutation implements Serializable {
private static final long serialVersionUID = 1243542667080258334L;
private final String readable;
private final List relations;
private Mutation() {
this("", Collections.emptyList());
}
private Mutation(String readable, List relations) {
this.readable = readable;
this.relations = Collections.unmodifiableList(new ArrayList<>(relations));
}
/**
* @return a readable {@link String} version of the transformation to be included in lineage.
*/
public String readable() {
return readable;
}
/**
* @return a {@link List} of {@link Relation} associated with the transformation.
*/
public List relations() {
return relations;
}
/**
* @return a instance of {@link Mutation.Builder}
*/
public static Mutation.Builder builder() {
return new Mutation.Builder();
}
/**
* Builder to create Mutation.
*/
public static class Builder {
private final List relations;
private String description;
/**
* A builder constructor.
*/
public Builder() {
this.relations = new ArrayList<>();
}
/**
* An easy way to created a formatted string of transformation.
*
* @param format a format string.
* @param args Arguments referenced by the format specifiers in the format string.
* @return a instance of {@link Mutation.Builder}.
*/
public Mutation.Builder readable(String format, Object ... args) {
this.description = String.format(format, args);
return this;
}
/**
* A variation to specify the readable string for transformation.
*
* @param format a format string.
* @param args Arguments referenced by the format specifiers in the format string.
* @return a instance of {@link Mutation.Builder}.
*/
public Mutation.Builder readable(String format, List