MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / Prop

Class Prop

src/main/java/field/utility/Dict.java:107–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105 }
106
107 static public class Prop<T> implements Serializable, fieldlinker.AsMap {
108 String name;
109
110 // static private final long serialVersionUID = -3019710755596488302L;
111 static private final long serialVersionUID = 957672202150481417L;
112
113
114 // optional type information
115 private List<Class> typeInformation;
116 public Class definedInClass;
117 private String documentation;
118
119 public Supplier<T> autoConstructor;
120
121 private Dict attributes;
122
123 private boolean canon = false;
124
125 public Prop(String name) {
126 this.name = name;
127
128 if (false) {
129 StackTraceElement[] s = new Exception().getStackTrace();
130 String[] pieces = s[1].getClassName()
131 .split("\\.");
132 documentation = "undocumented (defined inside <b>" + pieces[pieces.length - 1] + "</b>)";
133 }
134 }
135
136 public boolean containsSuffix(String string) {
137 if (name.contains("_")) {
138 String[] s = name.split("_");
139 for (int i = 1; i < s.length; i++) {
140 if (s[i].equals(string)) return true;
141 }
142 }
143 return false;
144 }
145
146 @Override
147 public boolean equals(Object obj) {
148 if (this == obj) return true;
149 if (obj == null) return false;
150 if (getClass() != obj.getClass()) return false;
151 final Prop other = (Prop) obj;
152 if (name == null) {
153 if (other.name != null) return false;
154 } else if (!name.equals(other.name)) return false;
155 return true;
156 }
157
158 public String getName() {
159 return name;
160 }
161
162 @Override
163 public int hashCode() {
164 final int PRIME = 31;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected