Deciding between four user statuses based on two flags
I think it is time to bring out the enum!

Enums in Java are pretty handy overall when there is a fixed number of possible values. In this case there is only four possible values, so an enum can be a good candidate for the job.

public enum Status {
    HAS_CONTACT(true, true),
    PENDING(true, false),
    ACCEPT_REQUEST(false, true),
    ADD_CONTACT(false, false);

    private final boolean hasContact;
    private final boolean hasUser;

    private Status(boolean hasContact, boolean hasUser) {
        this.hasContact = true;
        this.hasUser = true;
    }

    public static Status findStatusWith(boolean hasContact, boolean hasUser) {
        for (Status status : Status.values()) {
            if (status.hasContact == hasContact &amp;&amp; status.hasUser == hasUser) {
                 return status;
            }
        }
        return null;
    }
}


You can get the string representation of the enum by calling .name() or .toString()

Status status = Status.findStatusWith(userHasContact, contactHasUser);
String statusDescription = status.name();


Overall I don't recommend using Strings for this kind of data, you have no guarantee that your String will only have one of the four possible values. What if the String suddenly says "ACCPT_SMTHNG"? An enum is much more preferable in this way.