All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sap.cloud.security.ams.dcl.client.dcn.DcnContainer Maven / Gradle / Ivy

The newest version!
/************************************************************************
 * © 2019-2024 SAP SE or an SAP affiliate company. All rights reserved. *
 ************************************************************************/
package com.sap.cloud.security.ams.dcl.client.dcn;

import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Consumer;

import com.sap.cloud.security.ams.dcl.client.annotation.Beta;

@Beta
public class DcnContainer {
    private int version;

    private List policies;

    private List functions;

    private List schemas;

    private List tests;

    private Map metadata;

    private transient Object userData; // NOSONAR

    public List policies() {
        return policies; // NOSONAR
    }

    public DcnContainer policies(List policies) {
        this.policies = policies; // NOSONAR
        return this;
    }

    public List functions() {
        return functions; // NOSONAR
    }

    public DcnContainer functions(List functions) {
        this.functions = functions; // NOSONAR
        return this;
    }

    public int version() {
        return version;
    }

    public DcnContainer version(int version) {
        this.version = version;
        return this;
    }

    public List schemas() {
        return schemas; // NOSONAR
    }

    public DcnContainer schemas(List schemas) {
        this.schemas = schemas; // NOSONAR
        return this;
    }

    public List testCases() {
        return tests;
    }

    public DcnContainer testCases(List testCases) {
        this.tests = testCases;
        return this;
    }

    /**
     * Gets the custom user data. This data is not stored or loaded (i.e transient). The value is not take into account for hashCode() or
     * equals(Object other).
     * 
     * @return user data
     */
    public Object userData() {
        return userData;
    }

    /**
     * Sets the user data. This data is not stored or loaded (i.e transient). The value is not take into account for hashCode() or equals(Object
     * other).
     * 
     * @param userData
     *            custom user data
     * @return this
     */
    public DcnContainer userData(Object userData) {
        this.userData = userData;
        return this;
    }

    public Map metadata() {
        return metadata;
    }

    public DcnContainer metadata(Map metadata) {
        this.metadata = metadata;
        return this;
    }

    public DcnContainer apply(Consumer consumer) {
        consumer.accept(this);
        return this;
    }
    //

    @Override
    public String toString() {
        return "DcnDocument [policies=" + policies
                + ", functions=" + functions
                + ", schemas=" + schemas
                + ", version=" + version
                + ", tests=" + tests
                + ", metadata=" + metadata
                + "]";
    }

    @Override
    public int hashCode() {
        return Objects.hash(functions, policies, schemas, version, tests, metadata);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        DcnContainer other = (DcnContainer) obj;
        return version == other.version
                && Objects.equals(policies, other.policies)
                && Objects.equals(functions, other.functions)
                && Objects.equals(schemas, other.schemas)
                && Objects.equals(tests, other.tests)
                && Objects.equals(metadata, other.metadata);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy