Examples of EntityDescriptor


Examples of org.optaplanner.core.impl.domain.entity.descriptor.EntityDescriptor

        EntityDescriptor entityDescriptor = findEntityDescriptorOrFail(entity.getClass());
        return entityDescriptor.getGenuineVariableDescriptor(variableName);
    }

    public GenuineVariableDescriptor findGenuineVariableDescriptorOrFail(Object entity, String variableName) {
        EntityDescriptor entityDescriptor = findEntityDescriptorOrFail(entity.getClass());
        GenuineVariableDescriptor variableDescriptor = entityDescriptor.getGenuineVariableDescriptor(variableName);
        if (variableDescriptor == null) {
            throw new IllegalArgumentException(entityDescriptor.buildInvalidVariableNameExceptionMessage(variableName));
        }
        return variableDescriptor;
    }
View Full Code Here

Examples of org.optaplanner.core.impl.domain.entity.descriptor.EntityDescriptor

        }
        return variableDescriptor;
    }

    public VariableDescriptor findVariableDescriptor(Object entity, String variableName) {
        EntityDescriptor entityDescriptor = findEntityDescriptorOrFail(entity.getClass());
        return entityDescriptor.getVariableDescriptor(variableName);
    }
View Full Code Here

Examples of org.optaplanner.core.impl.domain.entity.descriptor.EntityDescriptor

        EntityDescriptor entityDescriptor = findEntityDescriptorOrFail(entity.getClass());
        return entityDescriptor.getVariableDescriptor(variableName);
    }

    public VariableDescriptor findVariableDescriptorOrFail(Object entity, String variableName) {
        EntityDescriptor entityDescriptor = findEntityDescriptorOrFail(entity.getClass());
        VariableDescriptor variableDescriptor = entityDescriptor.getVariableDescriptor(variableName);
        if (variableDescriptor == null) {
            throw new IllegalArgumentException(entityDescriptor.buildInvalidVariableNameExceptionMessage(variableName));
        }
        return variableDescriptor;
    }
View Full Code Here

Examples of org.optaplanner.core.impl.domain.entity.descriptor.EntityDescriptor

    public long getVariableCount(Solution solution) {
        long variableCount = 0L;
        for (PropertyAccessor entityPropertyAccessor : entityPropertyAccessorMap.values()) {
            Object entity = extractEntity(entityPropertyAccessor, solution);
            if (entity != null) {
                EntityDescriptor entityDescriptor = findEntityDescriptorOrFail(entity.getClass());
                variableCount += entityDescriptor.getVariableCount();
            }
        }
        for (PropertyAccessor entityCollectionPropertyAccessor : entityCollectionPropertyAccessorMap.values()) {
            Collection<?> entityCollection = extractEntityCollection(
                    entityCollectionPropertyAccessor, solution);
            for (Object entity : entityCollection) {
                EntityDescriptor entityDescriptor = findEntityDescriptorOrFail(entity.getClass());
                variableCount += entityDescriptor.getVariableCount();
            }
        }
        return variableCount;
    }
View Full Code Here

Examples of org.optaplanner.core.impl.domain.entity.descriptor.EntityDescriptor

    public long getProblemScale(Solution solution) {
        long problemScale = 0L;
        for (PropertyAccessor entityPropertyAccessor : entityPropertyAccessorMap.values()) {
            Object entity = extractEntity(entityPropertyAccessor, solution);
            if (entity != null) {
                EntityDescriptor entityDescriptor = findEntityDescriptorOrFail(entity.getClass());
                problemScale += entityDescriptor.getProblemScale(solution, entity);
            }
        }
        for (PropertyAccessor entityCollectionPropertyAccessor : entityCollectionPropertyAccessorMap.values()) {
            Collection<?> entityCollection = extractEntityCollection(
                    entityCollectionPropertyAccessor, solution);
            for (Object entity : entityCollection) {
                EntityDescriptor entityDescriptor = findEntityDescriptorOrFail(entity.getClass());
                problemScale += entityDescriptor.getProblemScale(solution, entity);
            }
        }
        return problemScale;
    }
View Full Code Here

Examples of org.optaplanner.core.impl.domain.entity.descriptor.EntityDescriptor

    public int countUninitializedVariables(Solution solution) {
        int count = 0;
        for (PropertyAccessor entityPropertyAccessor : entityPropertyAccessorMap.values()) {
            Object entity = extractEntity(entityPropertyAccessor, solution);
            if (entity != null) {
                EntityDescriptor entityDescriptor = findEntityDescriptorOrFail(entity.getClass());
                count += entityDescriptor.countUninitializedVariables(entity);
            }
        }
        for (PropertyAccessor entityCollectionPropertyAccessor : entityCollectionPropertyAccessorMap.values()) {
            Collection<?> entityCollection = extractEntityCollection(
                    entityCollectionPropertyAccessor, solution);
            for (Object entity : entityCollection) {
                EntityDescriptor entityDescriptor = findEntityDescriptorOrFail(entity.getClass());
                count += entityDescriptor.countUninitializedVariables(entity);
            }
        }
        return count;
    }
View Full Code Here

Examples of org.optaplanner.core.impl.domain.entity.descriptor.EntityDescriptor

     */
    public boolean isInitialized(ScoreDirector scoreDirector, Solution solution) {
        for (PropertyAccessor entityPropertyAccessor : entityPropertyAccessorMap.values()) {
            Object entity = extractEntity(entityPropertyAccessor, solution);
            if (entity != null) {
                EntityDescriptor entityDescriptor = findEntityDescriptorOrFail(entity.getClass());
                if (!entityDescriptor.isInitialized(entity)) {
                    if (!entityDescriptor.hasMovableEntitySelectionFilter()
                            || entityDescriptor.getMovableEntitySelectionFilter().accept(scoreDirector, entity)) {
                        return false;
                    }
                }
            }
        }
        for (PropertyAccessor entityCollectionPropertyAccessor : entityCollectionPropertyAccessorMap.values()) {
            Collection<?> entityCollection = extractEntityCollection(
                    entityCollectionPropertyAccessor, solution);
            for (Object entity : entityCollection) {
                EntityDescriptor entityDescriptor = findEntityDescriptorOrFail(entity.getClass());
                if (!entityDescriptor.isInitialized(entity)) {
                    if (!entityDescriptor.hasMovableEntitySelectionFilter()
                            || entityDescriptor.getMovableEntitySelectionFilter().accept(scoreDirector, entity)) {
                        return false;
                    }
                }
            }
        }
View Full Code Here

Examples of org.optaplanner.core.impl.domain.entity.descriptor.EntityDescriptor

    public int countReinitializableVariables(ScoreDirector scoreDirector, Solution solution) {
        int count = 0;
        for (PropertyAccessor entityPropertyAccessor : entityPropertyAccessorMap.values()) {
            Object entity = extractEntity(entityPropertyAccessor, solution);
            if (entity != null) {
                EntityDescriptor entityDescriptor = findEntityDescriptorOrFail(entity.getClass());
                count += entityDescriptor.countReinitializableVariables(scoreDirector, entity);
            }
        }
        for (PropertyAccessor entityCollectionPropertyAccessor : entityCollectionPropertyAccessorMap.values()) {
            Collection<?> entityCollection = extractEntityCollection(
                    entityCollectionPropertyAccessor, solution);
            for (Object entity : entityCollection) {
                EntityDescriptor entityDescriptor = findEntityDescriptorOrFail(entity.getClass());
                count += entityDescriptor.countReinitializableVariables(scoreDirector, entity);
            }
        }
        return count;
    }
View Full Code Here

Examples of org.qi4j.api.entity.EntityDescriptor

                    Assert.assertTrue( serviceDescriptor.isInstantiateOnStartup() );
                    Assert.assertTrue( serviceDescriptor.visibility() == Visibility.layer );
                    return false;
                } else if (visited instanceof EntityDescriptor)
                {
                    EntityDescriptor entityDescriptor = (EntityDescriptor) visited;
                    Assert.assertTrue( entityDescriptor.visibility() == Visibility.application );
                    return false;
                }

                return true;
            }
View Full Code Here

Examples of org.qi4j.api.entity.EntityDescriptor

                status = EntityStatus.UPDATED;
            }

            String type = jsonObject.getString( "type" );

            EntityDescriptor entityDescriptor = module.entityDescriptor( type );
            if( entityDescriptor == null )
            {
                throw new EntityTypeNotFoundException( type );
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.