public final Resource resource;
public final String name;
public final boolean internal;
+ /**
+ * Optional, may be null.
+ */
+ public final String type;
public RootSpec(Resource resource, String name, boolean internal) {
+ this(resource, name, internal, null);
+ }
+
+ public RootSpec(Resource resource, String name, boolean internal, String type) {
if (resource == null)
throw new NullPointerException("null resource");
if (name == null)
this.resource = resource;
this.name = name;
this.internal = internal;
+ this.type = type;
}
@Override
public String toString() {
- return "RootSpec[" + name + ", " + resource + ", " + internal + "]";
+ return "RootSpec[" + name + ", " + resource + ", " + internal + ", " + type + "]";
}
@Override
result = prime * result + (internal ? 1231 : 1237);
result = prime * result + resource.hashCode();
result = prime * result + name.hashCode();
+ result = prime * result + (type != null ? type.hashCode() : 0);
return result;
}
if (getClass() != obj.getClass())
return false;
RootSpec other = (RootSpec) obj;
- return internal == other.internal && resource.equals(other.resource) && name.equals(other.name);
+ return internal == other.internal && resource.equals(other.resource) && name.equals(other.name)
+ && objectEquals(type, other.type);
+ }
+
+ private boolean objectEquals(Object o1, Object o2) {
+ if (o1 == o2) return true;
+ if (o1 == null && o2 == null) return true;
+ if (o1 == null || o2 == null) return false;
+ return o1.equals(o2);
}
}
-
+
final public TreeMap<String, Variant> baseExtensions = new TreeMap<String,Variant>();
final public Resource indexRoot;
final public Collection<RootSpec> roots;