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

com.backendless.rt.command.Command Maven / Gradle / Ivy

The newest version!
package com.backendless.rt.command;

import com.backendless.rt.users.UserInfo;

import java.util.Map;

public class Command
{

  public static  Command of( Class dataType )
  {
    return new Command<>( dataType );
  }

  public static Command string(  )
  {
    return new Command<>( String.class );
  }

  public static Command map(  )
  {
    return new Command<>( Map.class );
  }

  private Command( Class dataType )
  {
    this.dataType = dataType;
  }

  private final transient Class dataType;
  private String type;
  private T data;
  private UserInfo userInfo;

  public String getType()
  {
    return type;
  }

  public Command setType( String type )
  {
    this.type = type;
    return this;
  }

  public T getData()
  {
    return data;
  }

  public Command setData( T data )
  {
    this.data = data;
    return this;
  }

  public UserInfo getUserInfo()
  {
    return userInfo;
  }

  public Command setUserInfo( UserInfo userInfo )
  {
    this.userInfo = userInfo;
    return this;
  }

  @Override
  public String toString()
  {
    return "RTCommand{" + "dataType=" + dataType + ", type='" + type + '\'' + ", data=" + data + ", userInfo=" + userInfo + '}';
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy