class ImmutableThing implements Thing {

    @Override
    public Thing setAttribute(final JsonPointer attributePath, final JsonValue attributeValue) {
        final Attributes newAttributes;
        if (null == attributes || attributes.isNull()) {
            newAttributes = ThingsModelFactory.newAttributesBuilder()
                    .set(attributePath, attributeValue)
                    .build();
        } else {
            newAttributes = attributes.setValue(attributePath, attributeValue);
        }

        return setAttributes(newAttributes);
    }

    private  ImmutableThing(@Nullable final ThingId thingId,
            @Nullable final AccessControlList acl,
            @Nullable final PolicyId policyId,
            @Nullable final ThingDefinition definition,
            @Nullable final Attributes attributes,
            @Nullable final Features features,
            @Nullable final ThingLifecycle lifecycle,
            @Nullable final ThingRevision revision,
            @Nullable final Instant modified,
            @Nullable final Instant created,
            @Nullable final Metadata metadata);

}