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

com.telekom.m2m.cot.restsdk.users.UserReference Maven / Gradle / Ivy

package com.telekom.m2m.cot.restsdk.users;

import com.telekom.m2m.cot.restsdk.util.ExtensibleObject;


/**
 * A class that represents a reference to a user. A reference holds the URL of a
 * given user. Created by Ozan Arslan on 25.07.2017
 */
public class UserReference extends ExtensibleObject {

    public UserReference() {
        super();
    }

    public UserReference(ExtensibleObject extensibleObject) {
        super(extensibleObject);
    }


    /**
     * The method to retrieve the user that the reference points to.
     * 
     * @return the user which the reference refers.
     */
    public User getUser() {
        ExtensibleObject obj = (ExtensibleObject) anyObject.get("user");
        return new User(obj);
    }

    /**
     * The method to retrieve the URL of the user that the reference holds.
     * 
     * @return the URL of the user.
     */
    public String getSelf() {
        return (String) anyObject.get("self");
    }

    public void setUser(User user) {
        anyObject.put("user", user);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy