Files
moe/moe-api/src/main/java/daxi/moe/model/AnyData.java
T
2026-10-31 18:24:58 +05:30

61 lines
1.4 KiB
Java

/*
* Copyright (c) DuxTechnica
*
* Licensed under the DuxTechnica Limited Use Source Code License Agreement (DT-LUSCL); you may not
* use this file except in compliance with the License. You may obtain a copy of the License by
* contacting:
*
* Dux Technica, [email protected]
*
* This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
package daxi.moe.model;
/**
* A class that can hold any of the three data types: {@link SimpleData}, {@link LinearData}, or
* {@link MappedData}. This class is used to represent a generic data type that can be one of those
* three types.
*
* @author indroneel
*/
public class AnyData {
private final SimpleData simple;
private final LinearData linear;
private final MappedData mapped;
public AnyData(SimpleData simple) {
this.simple = simple;
this.linear = null;
this.mapped = null;
}
public AnyData(LinearData linear) {
this.simple = null;
this.linear = linear;
this.mapped = null;
}
public AnyData(MappedData mapped) {
this.simple = null;
this.linear = null;
this.mapped = mapped;
}
public SimpleData asSimple() {
return simple;
}
public LinearData asLinear() {
return linear;
}
public MappedData asMapped() {
return mapped;
}
}