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

com.gs.obevo.api.appdata.PhysicalSchema Maven / Gradle / Ivy

There is a newer version: 8.2.1
Show newest version
/**
 * Copyright 2017 Goldman Sachs.
 * 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 com.gs.obevo.api.appdata;

import org.eclipse.collections.api.block.function.Function;

/**
 * Creating this marker class to separate the ideal schema (e.g. account/product) from the actual
 * physical schema we may deploy to in dev/qa/prod (e.g. account_d1, product_u2, product)
 */
public class PhysicalSchema {
    private final String physicalName;

    public static final Function TO_PHYSICAL_NAME = new Function() {
        @Override
        public String valueOf(PhysicalSchema physicalSchema) {
            return physicalSchema.getPhysicalName();
        }
    };

    public PhysicalSchema(String physicalName) {
        this.physicalName = physicalName;
    }

    public String getPhysicalName() {
        return this.physicalName;
    }

    // // GENERATED BY ECLIPSE ////
    @Override
    public int hashCode() {
        int prime = 31;
        int result = 1;
        result = prime * result + ((this.physicalName == null) ? 0 : this.physicalName.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (this.getClass() != obj.getClass()) {
            return false;
        }
        PhysicalSchema other = (PhysicalSchema) obj;
        if (this.physicalName == null) {
            if (other.physicalName != null) {
                return false;
            }
        } else if (!this.physicalName.equals(other.physicalName)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return this.physicalName;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy