2026-03-17 13:31:18 -07:00

137 lines
3.2 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package com.tridium.sys.schema;
import com.tridium.sys.schema.NSlot;
import com.tridium.sys.schema.Utils;
import java.lang.reflect.Modifier;
import javax.baja.sys.Action;
import javax.baja.sys.BFacets;
import javax.baja.sys.BObject;
import javax.baja.sys.BValue;
import javax.baja.sys.Property;
import javax.baja.sys.Sys;
import javax.baja.sys.Topic;
import javax.baja.sys.Type;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class NProperty
extends NSlot
implements Property {
public static final int TYPE_FINAL = 1;
public BValue value;
Class typeClass;
Type type;
int typeAccess;
int propertyFlags;
void init() {
if (Modifier.isFinal(this.typeClass.getModifiers())) {
this.propertyFlags |= 1;
}
}
public final boolean isProperty() {
return true;
}
public boolean isAction() {
return false;
}
public boolean isTopic() {
return false;
}
public final Property asProperty() {
return this;
}
public Action asAction() {
throw new ClassCastException();
}
public Topic asTopic() {
throw new ClassCastException();
}
public final int getTypeAccess() {
return this.typeAccess;
}
public final BValue getDefaultValue() {
return this.value.newCopy(true);
}
public final boolean isEquivalentToDefaultValue(BValue bValue) {
return this.value.equivalent(bValue);
}
public final Type getType() {
if (this.type == null) {
this.type = Sys.getType(this.typeClass);
}
return this.type;
}
public final Type getType(BObject bObject) {
return this.getType();
}
public final boolean isTypeFinal() {
boolean bl = false;
if ((this.propertyFlags & 1) != 0) {
bl = true;
}
return bl;
}
boolean equivalent(NProperty nProperty) {
if (!super.equivalent(nProperty)) {
return false;
}
return this.value.equivalent(nProperty.value);
}
void copyFrom(NSlot nSlot) {
super.copyFrom(nSlot);
NProperty nProperty = (NProperty)nSlot;
this.type = nProperty.type;
this.typeClass = nProperty.typeClass;
this.typeAccess = nProperty.typeAccess;
this.propertyFlags = nProperty.propertyFlags;
}
public String toString() {
return this.name + ": " + this.getType();
}
private final /* synthetic */ void this() {
this.typeAccess = -1;
}
public NProperty(int n, BValue bValue, BFacets bFacets) {
super(null, n, bFacets, true);
this.this();
this.value = bValue;
}
public NProperty(String string, int n, BValue bValue, BFacets bFacets) {
this(string, n, bValue, bFacets, false);
}
public NProperty(String string, int n, BValue bValue, BFacets bFacets, boolean bl) {
super(string, n, bFacets, bl);
this.this();
this.value = bValue;
this.type = bValue.getType();
this.typeClass = bValue.getClass();
this.typeAccess = Utils.getTypeAccess(this.typeClass);
this.init();
}
}