public SchemaHandlingType objectType(ResourceObjectTypeDefinitionType value) { getObjectType().add(value); return this; }
public SchemaHandlingType clone() { SchemaHandlingType object = new SchemaHandlingType(); PrismContainerValue value = asPrismContainerValue().clone(); object.setupContainerValue(value); return object; }
public ResourceObjectTypeDefinitionType beginObjectType() { ResourceObjectTypeDefinitionType value = new ResourceObjectTypeDefinitionType(); objectType(value); return value; }
public List<ResourceObjectTypeDefinitionType> createObjectTypeList() { PrismForJAXBUtil.createContainer(asPrismContainerValue(), F_OBJECT_TYPE); return getObjectType(); }
resource.asObjectable().setName(PolyStringType.fromOrig("resource1")); SchemaHandlingType schemaHandling = new SchemaHandlingType(prismContext); ResourceObjectTypeDefinitionType objectTypeDef = new ResourceObjectTypeDefinitionType(prismContext); objectTypeDef.setDefault(true); iterationSpecificationType.setMaxIterations(100); objectTypeDef.setIteration(iterationSpecificationType); schemaHandling.getObjectType().add(objectTypeDef); resource.asObjectable().setSchemaHandling(schemaHandling); resource.asObjectable().getSchemaHandling().getObjectType().get(0).setDefault(false); AssertJUnit.fail("Value of schemaHandling/[1]/default was changed when immutable!"); } catch (RuntimeException e) {
/** * Create an instance of {@link SchemaHandlingType } * */ public SchemaHandlingType createSchemaHandlingType() { return new SchemaHandlingType(); }
@Override public boolean equals(Object object) { if (!(object instanceof SchemaHandlingType)) { return false; } SchemaHandlingType other = ((SchemaHandlingType) object); return asPrismContainerValue().equivalent(other.asPrismContainerValue()); }
public SchemaHandlingType(PrismContext prismContext) { setupContainerValue(new PrismContainerValueImpl<>(this, prismContext)); }
@Override public void assertModification(PrismObject<ResourceType> resource, int iteration) { if (!schemaHandling.equals(resource.asObjectable().getSchemaHandling())) { System.out.println("Expected: " + PrismUtil.serializeQuietly(prismContext, schemaHandling)); System.out.println("Real: " + PrismUtil.serializeQuietly(prismContext, resource.asObjectable().getSchemaHandling())); fail("Wrong schemaHandling in iteration" + iteration); } //assertEquals("Wrong schemaHandling in iteration "+iteration, schemaHandling, resource.asObjectable().getSchemaHandling()); } });
/** * Create an instance of {@link SchemaHandlingType } * */ public SchemaHandlingType createSchemaHandlingType() { return new SchemaHandlingType(); }
@Override public String toString() { return asPrismContainerValue().toString(); }
@NotNull static List<ObjectTypeRecord> extractFrom(SchemaHandlingType schemaHandling) { List<ObjectTypeRecord> rv = new ArrayList<>(); if (schemaHandling != null) { for (ResourceObjectTypeDefinitionType objectType : schemaHandling.getObjectType()) { rv.add(new ObjectTypeRecord(objectType)); } } return rv; }
/** * Create an instance of {@link SchemaHandlingType } * */ public SchemaHandlingType createSchemaHandlingType() { return new SchemaHandlingType(); }
@Override public int hashCode() { return asPrismContainerValue().hashCode(); }
private void checkSchemaHandlingObjectTypes(ResourceValidationContext ctx, SchemaHandlingType schemaHandling) { int i = 1; for (ResourceObjectTypeDefinitionType objectType : schemaHandling.getObjectType()) { ItemPath path = ItemPath.create(ResourceType.F_SCHEMA_HANDLING, SchemaHandlingType.F_OBJECT_TYPE, i); checkSchemaHandlingObjectType(ctx, path, objectType); i++; } }
public SchemaHandlingType beginSchemaHandling() { SchemaHandlingType value = new SchemaHandlingType(); schemaHandling(value); return value; }
@XmlElement(name = "objectType") public List<ResourceObjectTypeDefinitionType> getObjectType() { PrismContainerValue pcv = asPrismContainerValue(); PrismContainer container = PrismForJAXBUtil.getContainer(pcv, F_OBJECT_TYPE); return new SchemaHandlingType.AnonObjectType(container, pcv); }
private static SchemaHandlingType createNewSchemaHandling(File resourceFile, int iteration, PrismContext prismContext) throws SchemaException { PrismObject<ResourceType> resource = parseResource(resourceFile, prismContext); SchemaHandlingType schemaHandling = resource.asObjectable().getSchemaHandling(); ResourceObjectTypeDefinitionType accountType = schemaHandling.getObjectType().iterator().next(); List<ResourceAttributeDefinitionType> attrDefs = accountType.getAttribute(); ResourceAttributeDefinitionType attributeDefinitionType = attrDefs.get(rnd.nextInt(attrDefs.size())); attributeDefinitionType.setDescription(Integer.toString(iteration)); return schemaHandling; }
public void setSchemaHandling(SchemaHandlingType value) { PrismContainerValue fieldContainerValue = ((value!= null)?value.asPrismContainerValue():null); PrismForJAXBUtil.setFieldContainerValue(asPrismContainerValue(), F_SCHEMA_HANDLING, fieldContainerValue); }
public static ResourceObjectTypeDefinitionType findObjectTypeDefinition(PrismObject<ResourceType> resourceObject, @Nullable ShadowKindType kind, @Nullable String intent) { if (resourceObject == null || resourceObject.asObjectable().getSchemaHandling() == null) { return null; } for (ResourceObjectTypeDefinitionType def : resourceObject.asObjectable().getSchemaHandling().getObjectType()) { if (fillDefault(kind).equals(fillDefault(def.getKind())) && fillDefault(intent).equals(fillDefault(def.getIntent()))) { return def; } } return null; }