<commit_before>package com.kryptnostic.storage.v2.models;

import java.util.UUID;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Optional;
import com.kryptnostic.v2.constants.Names;
import com.kryptnostic.v2.storage.types.TypeUUIDs;

public class CreateObjectRequest {
    private static final boolean               INHERITING_OWNERSHIP_DEFAULT      = true;
    private static final boolean               INHERITING_CRYPTO_SERVICE_DEFAULT = true;
    private static final boolean               LOCKED_OBJECT_DEFAULT             = true;

    private final UUID                         type;
    private final Optional<VersionedObjectKey> objectId;
    private final Optional<VersionedObjectKey> parentObjectId;
    private final boolean                      inheritingOwnership;
    private final boolean                      inheritingCryptoService;
    private final boolean                      locked;

    public CreateObjectRequest() {
        this(
                TypeUUIDs.DEFAULT_TYPE,
                Optional.<VersionedObjectKey> absent(),
                Optional.<VersionedObjectKey> absent(),
                Optional.<Boolean> absent(),
                Optional.<Boolean> absent(),
                Optional.<Boolean> absent() );
    }

    @JsonCreator
    public CreateObjectRequest(
            @JsonProperty( Names.TYPE_FIELD ) UUID type,
            @JsonProperty( Names.PARENT_OBJECT_ID_FIELD ) Optional<VersionedObjectKey> parentObjectId,
            @JsonProperty( Names.ID_FIELD ) Optional<VersionedObjectKey> objectId,
            @JsonProperty( Names.INHERITING_OWNERSHIP_FIELD ) Optional<Boolean> inheritOwnership,
            @JsonProperty( Names.INHERITING_CRYPTO_SERVICE_FIELD ) Optional<Boolean> inheritCryptoService,
            @JsonProperty( Names.LOCKED_FIELD ) Optional<Boolean> locked ) {
        this.type = type;
        this.parentObjectId = parentObjectId;
        this.objectId = objectId;
        this.inheritingOwnership = inheritOwnership.or( INHERITING_OWNERSHIP_DEFAULT );
        this.inheritingCryptoService = inheritCryptoService.or( INHERITING_CRYPTO_SERVICE_DEFAULT );
        this.locked = locked.or( LOCKED_OBJECT_DEFAULT );
    }

    @JsonProperty( Names.TYPE_FIELD )
    public UUID getType() {
        return type;
    }

    @JsonProperty( Names.ID_FIELD )
    public Optional<VersionedObjectKey> getObjectId() {
        return objectId;
    }

    @JsonProperty( Names.PARENT_OBJECT_ID_FIELD )
    public Optional<VersionedObjectKey> getParentId() {
        return parentObjectId;
    }

    @JsonProperty( Names.INHERITING_OWNERSHIP_FIELD )
    public boolean isInheritingOwnership() {
        return inheritingOwnership;
    }

    @JsonProperty( Names.INHERITING_CRYPTO_SERVICE_FIELD )
    public boolean isInheritingCryptoService() {
        return inheritingCryptoService;
    }

    @JsonProperty( Names.LOCKED_FIELD )
    public boolean isLocked() {
        return locked;
    }
}<commit_msg>add a builder to CreateObjectRequest<commit_after>package com.kryptnostic.storage.v2.models;

import java.util.UUID;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Optional;
import com.kryptnostic.v2.constants.Names;
import com.kryptnostic.v2.storage.types.TypeUUIDs;

public class CreateObjectRequest {
    private static final boolean               INHERITING_OWNERSHIP_DEFAULT      = true;
    private static final boolean               INHERITING_CRYPTO_SERVICE_DEFAULT = true;
    private static final boolean               LOCKED_OBJECT_DEFAULT             = true;

    private final UUID                         type;
    private final Optional<VersionedObjectKey> objectId;
    private final Optional<VersionedObjectKey> parentObjectId;
    private final boolean                      inheritingOwnership;
    private final boolean                      inheritingCryptoService;
    private final boolean                      locked;

    public CreateObjectRequest() {
        this(
                TypeUUIDs.DEFAULT_TYPE,
                Optional.<VersionedObjectKey> absent(),
                Optional.<VersionedObjectKey> absent(),
                Optional.<Boolean> absent(),
                Optional.<Boolean> absent(),
                Optional.<Boolean> absent() );
    }

    @JsonCreator
    public CreateObjectRequest(
            @JsonProperty( Names.TYPE_FIELD ) UUID type,
            @JsonProperty( Names.PARENT_OBJECT_ID_FIELD ) Optional<VersionedObjectKey> parentObjectId,
            @JsonProperty( Names.ID_FIELD ) Optional<VersionedObjectKey> objectId,
            @JsonProperty( Names.INHERITING_OWNERSHIP_FIELD ) Optional<Boolean> inheritOwnership,
            @JsonProperty( Names.INHERITING_CRYPTO_SERVICE_FIELD ) Optional<Boolean> inheritCryptoService,
            @JsonProperty( Names.LOCKED_FIELD ) Optional<Boolean> locked) {
        this.type = type;
        this.parentObjectId = parentObjectId;
        this.objectId = objectId;
        this.inheritingOwnership = inheritOwnership.or( INHERITING_OWNERSHIP_DEFAULT );
        this.inheritingCryptoService = inheritCryptoService.or( INHERITING_CRYPTO_SERVICE_DEFAULT );
        this.locked = locked.or( LOCKED_OBJECT_DEFAULT );
    }

    @JsonProperty( Names.TYPE_FIELD )
    public UUID getType() {
        return type;
    }

    @JsonProperty( Names.ID_FIELD )
    public Optional<VersionedObjectKey> getObjectId() {
        return objectId;
    }

    @JsonProperty( Names.PARENT_OBJECT_ID_FIELD )
    public Optional<VersionedObjectKey> getParentId() {
        return parentObjectId;
    }

    @JsonProperty( Names.INHERITING_OWNERSHIP_FIELD )
    public boolean isInheritingOwnership() {
        return inheritingOwnership;
    }

    @JsonProperty( Names.INHERITING_CRYPTO_SERVICE_FIELD )
    public boolean isInheritingCryptoService() {
        return inheritingCryptoService;
    }

    @JsonProperty( Names.LOCKED_FIELD )
    public boolean isLocked() {
        return locked;
    }

    public static class Builder {
        private UUID                         type                 = TypeUUIDs.DEFAULT_TYPE;
        private Optional<VersionedObjectKey> parentObjectkey      = Optional.<VersionedObjectKey> absent();
        private Optional<VersionedObjectKey> objectId             = Optional.<VersionedObjectKey> absent();
        private Optional<Boolean>            inheritOwnership     = Optional.<Boolean> absent();
        private Optional<Boolean>            inheritCryptoService = Optional.<Boolean> absent();
        private Optional<Boolean>            locked               = Optional.<Boolean> absent();

        public Builder setType( UUID type ) {
            this.type = type;
            return this;
        }

        public Builder setParentObjectId( VersionedObjectKey parentObjectId ) {
            this.parentObjectkey = Optional.<VersionedObjectKey> of( parentObjectId );
            return this;
        }

        public Builder setObjectId( VersionedObjectKey objectId ) {
            this.objectId = Optional.<VersionedObjectKey> of( objectId );
            return this;
        }

        public Builder setInheritOwnership( Boolean inheritOwnership ) {
            this.inheritOwnership = Optional.<Boolean> of( inheritOwnership );
            return this;
        }

        public Builder setInheritCryptoService( Boolean inheritCryptoService ) {
            this.inheritCryptoService = Optional.<Boolean> of( inheritCryptoService );
            return this;
        }

        public Builder setLocked( Boolean locked ) {
            this.locked = Optional.<Boolean> of( locked );
            return this;
        }

        public CreateObjectRequest createCreateObjectRequest() {
            return new CreateObjectRequest(
                    type,
                    parentObjectkey,
                    objectId,
                    inheritOwnership,
                    inheritCryptoService,
                    locked );
        }
    }

}
{'fraction_non_alphanumeric': 0.07133177282247136, 'fraction_numerical': 0.0007391893556732783, 'mean_word_length': 2.4471337579617836, 'pattern_counts': {'":': 0, '<': 46, '<?xml version=': 0, '>': 46, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1465400', 'n_tokens_mistral': 2132, 'n_tokens_neox': 2063, 'n_words': 427}