Files
Flintstones/bundles/flintstones.entity.problemelement/src/flintstones/entity/problemelement/entities/FakeProblemElement.java
T
Francisco Jesús Martínez Mimbrera 759a8968a2 public code v1
2026-05-23 00:32:57 +02:00

75 lines
1.3 KiB
Java

package flintstones.entity.problemelement.entities;
import org.apache.commons.lang.NotImplementedException;
/**
* The Class FakeProblemElement makes posible to use a dummy ProblemElement with some components.
*/
public class FakeProblemElement extends ProblemElement {
/** The Type. */
public static String Type = FakeProblemElement.class.getSimpleName();
/**
* Instantiates a new fake problem element.
*/
public FakeProblemElement(String name) {
setName(name);
setType(FakeProblemElement.Type);
updateId();
}
/* (non-Javadoc)
* @see flintstones.entity.problemelement.entities.ProblemElement#clone()
*/
@Override
public Object clone() {
throw new NotImplementedException();
}
/**
* As alternative.
*
* @return the problem element
*/
public ProblemElement asAlternative() {
this.setType(Alternative.Type);
return this;
}
/**
* As criterion.
*
* @return the problem element
*/
public ProblemElement asCriterion() {
this.setType(Criterion.Type);
return this;
}
/**
* As expert.
*
* @return the problem element
*/
public ProblemElement asExpert() {
this.setType(Expert.Type);
return this;
}
/**
* As.
*
* @param type the type
*/
public ProblemElement as(String type) {
this.setType(type);
return this;
}
@Override
public String calculateId() {
return getName();
}
}