
org.fulib.scenarios.ast.pattern.Pattern Maven / Gradle / Ivy
Show all versions of fulibScenarios Show documentation
// Generated by GenTreeSrc v0.10.2
// DO NOT EDIT - CHANGES WILL BE LOST ON RE-GENERATE
package org.fulib.scenarios.ast.pattern;
import java.util.List;
import org.fulib.scenarios.ast.Node;
import org.fulib.scenarios.ast.decl.Name;
import org.fulib.scenarios.ast.type.Type;
public interface Pattern extends Node
{
// =============== Static Methods ===============
static Pattern of(Type type, Name name, List constraints) { return new Impl(type, name, constraints); }
// =============== Properties ===============
Type getType();
void setType(Type type);
Name getName();
void setName(Name name);
List getConstraints();
void setConstraints(List constraints);
// =============== Methods ===============
default R accept(Pattern.Visitor
visitor, P par) { return visitor.visit(this, par); }
@Override default
R accept(Node.Visitor
visitor, P par) { return visitor.visit(this, par); }
// =============== Classes ===============
class Impl implements Pattern
{
// =============== Fields ===============
private Type type;
private Name name;
private List constraints;
// =============== Constructors ===============
public Impl() {}
public Impl(Type type, Name name, List constraints)
{
this.type = type;
this.name = name;
this.constraints = constraints;
}
// =============== Properties ===============
@Override public Type getType() { return this.type; }
@Override public void setType(Type type) { this.type = type; }
@Override public Name getName() { return this.name; }
@Override public void setName(Name name) { this.name = name; }
@Override public List getConstraints() { return this.constraints; }
@Override public void setConstraints(List constraints) { this.constraints = constraints; }
}
interface Visitor
{
// =============== Methods ===============
default R visit(Pattern pattern, P par) { throw new UnsupportedOperationException(this.getClass().getName() + ".visit(" + pattern.getClass().getName() + ")"); }
}
}