Skip to content

Commit

Permalink
Remove getMap from API
Browse files Browse the repository at this point in the history
Fix warning in javadoc generation
  • Loading branch information
nfeybesse committed Oct 24, 2016
1 parent 4ffba01 commit 203d9f4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 24 deletions.
22 changes: 6 additions & 16 deletions gs-api/src/main/java/org/genericsystem/api/core/IRoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@
public interface IRoot<T extends IGeneric<T>> extends IGeneric<T> {

/**
* This Method returns a node reference from the Generic System graph which
* corresponds to the class given as parameter. The node is statically
* created at startup should the java annotation @SystemGeneric has been
* positioned in the given Class. Thus the nodes created are permanently
* accessible through this method and are not removable. It's a secure and
* extremely fast way to a get a reference on a specific node. The
* specialization of implementation class can improve the standard behavior.
* This Method returns a node reference from the Generic System graph which corresponds to the class given as parameter. The node is statically created at startup should the java annotation @SystemGeneric has been positioned in the given Class. Thus
* the nodes created are permanently accessible through this method and are not removable. It's a secure and extremely fast way to a get a reference on a specific node. The specialization of implementation class can improve the standard behavior.
*
* @param <Custom>
* a customizable subtype of T.
Expand All @@ -29,8 +24,7 @@ public interface IRoot<T extends IGeneric<T>> extends IGeneric<T> {
<Custom extends T> Custom find(Class<?> clazz);

/**
* Return a vertex built during new Root. If called during Root
* initialization, mount system node if nesscessary
* Return a vertex built during new Root. If called during Root initialization, mount system node if nesscessary
*
* @param <Custom>
* an implementation of a customizable subtype of T.
Expand All @@ -57,26 +51,22 @@ public interface IRoot<T extends IGeneric<T>> extends IGeneric<T> {
*/

/**
* Return the meta attribute. The meta attribute is the super of all
* attributes.
* Return the meta attribute. The meta attribute is the super of all attributes.
*
* @return the meta attribute.
*/
T getMetaAttribute();

/**
* Return the meta relation. The meta relation is the super of all
* relations.
* Return the meta relation. The meta relation is the super of all relations.
*
* @return the meta relation.
*/
T getMetaRelation();

/**
* Close the root. All changes done in the cache but not committed are
* automatically rollbacked. Persist the last state of the engine.
* Close the root. All changes done in the cache but not committed are automatically rollbacked. Persist the last state of the engine.
*/
void close();

T getMap();
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.lang.annotation.Target;
import java.util.Iterator;
import java.util.List;

import org.genericsystem.api.core.IGeneric;

/**
Expand All @@ -29,9 +30,13 @@
public static interface ValueGenerator<T extends IGeneric<T>> {
/**
* @param meta
* the meta of generic to create.
* @param supers
* the supers of the generic to create
* @param value
* the value proposed of the generic to create
* @param components
* the components of the generic to create
* @return the generate value for new instances
*/
Serializable generateInstanceValue(T meta, List<T> supers, Serializable value, List<T> components);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ default boolean inheritsFrom(T superMeta, List<T> overrides, Serializable superV

default boolean isDependencyOf(T meta, List<T> supers, Serializable value, List<T> components) {

return (inheritsFrom(meta, supers, value, components) || getComponents().stream().anyMatch(component -> component.isDependencyOf(meta, supers, value, components)) || (!isMeta() && getMeta().isDependencyOf(meta, supers, value, components)) || (!components
.equals(getComponents()) && componentsDepends(getComponents(), components) && supers.stream().anyMatch(override -> override.inheritsFrom(getMeta()))));
return (inheritsFrom(meta, supers, value, components) || getComponents().stream().anyMatch(component -> component.isDependencyOf(meta, supers, value, components)) || (!isMeta() && getMeta().isDependencyOf(meta, supers, value, components))
|| (!components.equals(getComponents()) && componentsDepends(getComponents(), components) && supers.stream().anyMatch(override -> override.inheritsFrom(getMeta()))));

}

Expand Down Expand Up @@ -301,11 +301,6 @@ default boolean isSystem() {
return ApiStatics.TS_SYSTEM == getBirthTs();
}

@Override
default DefaultRoot<T> getRoot() {
throw new IllegalStateException();
}

@Override
default int compareTo(T generic) {
long birthTs = getBirthTs();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ default T getMetaRelation() {
return find(MetaRelation.class);
}

@Override
default T getMap() {
return find(SystemMap.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ default T setSystemPropertyValue(Class<? extends SystemProperty> propertyClass,
return (T) this;
}

@Override
DefaultRoot<T> getRoot();

@Override
@SuppressWarnings("unchecked")
default T enableSystemProperty(Class<? extends SystemProperty> propertyClass, int pos, T... targets) {
Expand Down

0 comments on commit 203d9f4

Please sign in to comment.