test_class.declarator: KNOWN_RESOURCE_PATH_0 = JsonPointer.empty()
test_class.modifier: private static final
test_class.original_string: private static final JsonPointer KNOWN_RESOURCE_PATH_0 = JsonPointer.empty();
test_class.type: JsonPointer
test_class.var_name: KNOWN_RESOURCE_PATH_0
test_class.declarator: KNOWN_RESOURCE_PATH_1 = JsonPointer.of("/foo/bar")
test_class.modifier: private static final
test_class.original_string: private static final JsonPointer KNOWN_RESOURCE_PATH_1 = JsonPointer.of("/foo/bar");
test_class.type: JsonPointer
test_class.var_name: KNOWN_RESOURCE_PATH_1
test_class.file: model/policies/src/test/java/org/eclipse/ditto/model/policies/ImmutableResourcesTest.java
test_class.identifier: ImmutableResourcesTest
test_case.body: @Test(expected = IllegalArgumentException.class)
      public void createResourcesWithSamePathsShouldFail() {
          final Collection<Resource> resourceList = new ArrayList<>();
          resourceList.add(Resource.newInstance(ResourceKey.newInstance(RESOURCE_TYPE, KNOWN_RESOURCE_PATH_1),
                  EffectedPermissions.newInstance(PERMISSIONS_ALL, PoliciesModelFactory.noPermissions())));
          resourceList.add(Resource.newInstance(ResourceKey.newInstance(RESOURCE_TYPE, KNOWN_RESOURCE_PATH_1),
                  EffectedPermissions.newInstance(PoliciesModelFactory.noPermissions(),
                          PoliciesModelFactory.newPermissions(TestConstants.Policy.PERMISSION_READ))));
  
          ImmutableResources.of(resourceList);
      }
test_case.class_method_signature: ImmutableResourcesTest.createResourcesWithSamePathsShouldFail()
test_case.full_signature: @Test(expected = IllegalArgumentException.class) public void createResourcesWithSamePathsShouldFail()
test_case.identifier: createResourcesWithSamePathsShouldFail
test_case.invocations: add newInstance newInstance newInstance noPermissions add newInstance newInstance newInstance noPermissions newPermissions of
test_case.modifiers: @Test(expected = IllegalArgumentException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void createResourcesWithSamePathsShouldFail()
focal_class.declarator: resources
focal_class.modifier: private final
focal_class.original_string: private final Map<ResourceKey, Resource> resources;
focal_class.type: Map<ResourceKey, Resource>
focal_class.var_name: resources
focal_class.file: model/policies/src/main/java/org/eclipse/ditto/model/policies/ImmutableResources.java
focal_class.identifier: ImmutableResources
focal_class.interfaces: implements Resources
focal_class.class_method_signature: ImmutableResources.ImmutableResources(final Map<ResourceKey, Resource> theResources)
focal_class.full_signature: private  ImmutableResources(final Map<ResourceKey, Resource> theResources)
focal_class.identifier: ImmutableResources
focal_class.modifiers: private
focal_class.parameters: (final Map<ResourceKey, Resource> theResources)
focal_class.signature:  ImmutableResources(final Map<ResourceKey, Resource> theResources)
focal_class.class_method_signature: ImmutableResources.of(final Iterable<Resource> resources)
focal_class.full_signature: public static ImmutableResources of(final Iterable<Resource> resources)
focal_class.identifier: of
focal_class.modifiers: public static
focal_class.parameters: (final Iterable<Resource> resources)
focal_class.return: ImmutableResources
focal_class.signature: ImmutableResources of(final Iterable<Resource> resources)
focal_class.class_method_signature: ImmutableResources.fromJson(final JsonObject jsonObject)
focal_class.full_signature: public static Resources fromJson(final JsonObject jsonObject)
focal_class.identifier: fromJson
focal_class.modifiers: public static
focal_class.parameters: (final JsonObject jsonObject)
focal_class.return: Resources
focal_class.signature: Resources fromJson(final JsonObject jsonObject)
focal_class.class_method_signature: ImmutableResources.getResource(final ResourceKey resourceKey)
focal_class.full_signature: @Override public Optional<Resource> getResource(final ResourceKey resourceKey)
focal_class.identifier: getResource
focal_class.modifiers: @Override public
focal_class.parameters: (final ResourceKey resourceKey)
focal_class.return: Optional<Resource>
focal_class.signature: Optional<Resource> getResource(final ResourceKey resourceKey)
focal_class.class_method_signature: ImmutableResources.setResource(final Resource resource)
focal_class.full_signature: @Override public Resources setResource(final Resource resource)
focal_class.identifier: setResource
focal_class.modifiers: @Override public
focal_class.parameters: (final Resource resource)
focal_class.return: Resources
focal_class.signature: Resources setResource(final Resource resource)
focal_class.class_method_signature: ImmutableResources.createNewResourcesWithNewResource(final Resource newResource)
focal_class.full_signature: private Resources createNewResourcesWithNewResource(final Resource newResource)
focal_class.identifier: createNewResourcesWithNewResource
focal_class.modifiers: private
focal_class.parameters: (final Resource newResource)
focal_class.return: Resources
focal_class.signature: Resources createNewResourcesWithNewResource(final Resource newResource)
focal_class.class_method_signature: ImmutableResources.copyResources()
focal_class.full_signature: private Map<ResourceKey, Resource> copyResources()
focal_class.identifier: copyResources
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Map<ResourceKey, Resource>
focal_class.signature: Map<ResourceKey, Resource> copyResources()
focal_class.class_method_signature: ImmutableResources.removeResource(final ResourceKey resourceKey)
focal_class.full_signature: @Override public Resources removeResource(final ResourceKey resourceKey)
focal_class.identifier: removeResource
focal_class.modifiers: @Override public
focal_class.parameters: (final ResourceKey resourceKey)
focal_class.return: Resources
focal_class.signature: Resources removeResource(final ResourceKey resourceKey)
focal_class.class_method_signature: ImmutableResources.getSize()
focal_class.full_signature: @Override public int getSize()
focal_class.identifier: getSize
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getSize()
focal_class.class_method_signature: ImmutableResources.isEmpty()
focal_class.full_signature: @Override public boolean isEmpty()
focal_class.identifier: isEmpty
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isEmpty()
focal_class.class_method_signature: ImmutableResources.toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.full_signature: @Override public JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.identifier: toJson
focal_class.modifiers: @Override public
focal_class.parameters: (final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.return: JsonObject
focal_class.signature: JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.class_method_signature: ImmutableResources.resourcesToJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.full_signature: private JsonObject resourcesToJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.identifier: resourcesToJson
focal_class.modifiers: private
focal_class.parameters: (final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.return: JsonObject
focal_class.signature: JsonObject resourcesToJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate)
focal_class.class_method_signature: ImmutableResources.iterator()
focal_class.full_signature: @Override public Iterator<Resource> iterator()
focal_class.identifier: iterator
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Iterator<Resource>
focal_class.signature: Iterator<Resource> iterator()
focal_class.class_method_signature: ImmutableResources.stream()
focal_class.full_signature: @Override public Stream<Resource> stream()
focal_class.identifier: stream
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Stream<Resource>
focal_class.signature: Stream<Resource> stream()
focal_class.class_method_signature: ImmutableResources.equals(final Object o)
focal_class.full_signature: @Override public boolean equals(final Object o)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (final Object o)
focal_class.return: boolean
focal_class.signature: boolean equals(final Object o)
focal_class.class_method_signature: ImmutableResources.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: ImmutableResources.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: public static ImmutableResources of(final Iterable<Resource> resources) {
          checkNotNull(resources, "resources");
  
          final Map<ResourceKey, Resource> resourcesMap = new HashMap<>();
          resources.forEach(resource -> {
              final Resource existingResource = resourcesMap.put(resource.getResourceKey(), resource);
              if (null != existingResource) {
                  final String msgTemplate = "There is more than one Resource with the path <{0}>!";
                  throw new IllegalArgumentException(MessageFormat.format(msgTemplate, resource.getPath()));
              }
          });
  
          return new ImmutableResources(resourcesMap);
      }
focal_method.class_method_signature: ImmutableResources.of(final Iterable<Resource> resources)
focal_method.full_signature: public static ImmutableResources of(final Iterable<Resource> resources)
focal_method.identifier: of
focal_method.invocations: checkNotNull forEach put getResourceKey format getPath
focal_method.modifiers: public static
focal_method.parameters: (final Iterable<Resource> resources)
focal_method.return: ImmutableResources
focal_method.signature: ImmutableResources of(final Iterable<Resource> resources)