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

edu.stanford.protege.webprotege.issues.mention.UserIdMention Maven / Gradle / Ivy

There is a newer version: 2.0.2-WHO
Show newest version
package edu.stanford.protege.webprotege.issues.mention;


import edu.stanford.protege.webprotege.common.UserId;
import edu.stanford.protege.webprotege.issues.Mention;

import javax.annotation.Nonnull;
import java.util.Optional;

import static com.google.common.base.MoreObjects.toStringHelper;

/**
 * Matthew Horridge
 * Stanford Center for Biomedical Informatics Research
 * 27 Sep 16
 */
public class UserIdMention extends Mention {

    @Nonnull
    private UserId userId;


    public UserIdMention(@Nonnull UserId userId) {
        this.userId = userId;
    }


    private UserIdMention() {
    }

    @Nonnull
    public UserId getUserId() {
        return userId;
    }

    /**
     * If this mention mentions a UserId then this method returns the UserId.
     *
     * @return The UserId.
     */
    @Nonnull
    @Override
    public Optional getMentionedUserId() {
        return Optional.of(userId);
    }

    @Override
    public String toString() {
        return toStringHelper("UserIdMention")
                .addValue(userId)
                .toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy