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

org.finos.tracdap.svc.meta.dal.MetadataBatchUpdate Maven / Gradle / Ivy

Go to download

TRAC D.A.P. metadata service, stateless service component to answer the TRAC metadata API

There is a newer version: 0.6.3
Show newest version
/*
 * Copyright 2023 Accenture Global Solutions Limited
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.finos.tracdap.svc.meta.dal;

import org.finos.tracdap.metadata.Tag;
import org.finos.tracdap.metadata.TagHeader;

import java.util.List;


public class MetadataBatchUpdate {

    private final List preallocatedIds;
    private final List preallocatedObjects;
    private final List newObjects;
    private final List newVersions;
    private final List newTags;


    public MetadataBatchUpdate(
            List preallocatedIds,
            List preallocatedObjects,
            List newObjects,
            List newVersions,
            List newTags) {

        this.preallocatedIds = preallocatedIds;
        this.preallocatedObjects = preallocatedObjects;
        this.newObjects = newObjects;
        this.newVersions = newVersions;
        this.newTags = newTags;
    }

    public List getPreallocatedIds() {
        return preallocatedIds;
    }

    public List getPreallocatedObjects() {
        return preallocatedObjects;
    }

    public List getNewObjects() {
        return newObjects;
    }

    public List getNewVersions() {
        return newVersions;
    }

    public List getNewTags() {
        return newTags;
    }

    @Override
    public String toString() {

        // For logging / debugging

        var nPrealloatedIds = preallocatedIds == null ? "(null)" : preallocatedIds.size();
        var nPreallocatedObjects = preallocatedIds == null ? "(null)" : preallocatedObjects.size();
        var nNewObjects = preallocatedIds == null ? "(null)" : newObjects.size();
        var nNewVersions = preallocatedIds == null ? "(null)" : newVersions.size();
        var nNewTags = preallocatedIds == null ? "(null)" : newTags.size();

        return String.format(
                "{preallocatedIds = %s, preallocatedObjects = %s, newObjects = %s, newVersions = %s, newTags = %s}",
                nPrealloatedIds, nPreallocatedObjects,
                nNewObjects, nNewVersions, nNewTags);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy