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

org.meeuw.i18n.regions.UserAssignedRegion Maven / Gradle / Ivy

Go to download

Provides the service loader for Regions, and some utilities to deal with regions generally

There is a newer version: 2.1.0
Show newest version
package org.meeuw.i18n.regions;

import org.checkerframework.checker.nullness.qual.NonNull;

/**
 * User assigned regions have a method {@link #getAssignedBy()}
 *
 * @author Michiel Meeuwissen
 * @since 0.1
 */
public abstract class UserAssignedRegion implements Region {

    protected final String code;
    protected final String name;
    protected final String assignedBy;

    protected UserAssignedRegion(
        @NonNull String code,
        @NonNull String name, String assignedBy) {
        this.code = code;
        this.name = name;
        this.assignedBy = assignedBy;
    }

    @Override
    public String getCode() {
        return code;
    }

    public String getAssignedBy() {
        return assignedBy;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserAssignedRegion that = (UserAssignedRegion) o;
        return code.equals(that.code);
    }

    @Override
    public int hashCode() {
        return code.hashCode();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy