htiextension/com.nokia.s60tools.hticonnection/src/com/nokia/s60tools/hticonnection/core/RequestResult.java
changeset 0 61163b28edca
equal deleted inserted replaced
-1:000000000000 0:61163b28edca
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 package com.nokia.s60tools.hticonnection.core;
       
    19 
       
    20 import java.util.List;
       
    21 
       
    22 import com.nokia.HTI.HTIMessage;
       
    23 import com.nokia.HTI.ApplicationControlService.AppStatus;
       
    24 import com.nokia.s60tools.hticonnection.services.DriveInfo;
       
    25 import com.nokia.s60tools.hticonnection.services.FileInfo;
       
    26 import com.nokia.s60tools.hticonnection.services.HTIScreenMode;
       
    27 import com.nokia.s60tools.hticonnection.services.HTIVersion;
       
    28 
       
    29 /**
       
    30  * Class to contain result of request. 
       
    31  */
       
    32 public class RequestResult {
       
    33 
       
    34 	// Data for the request result.
       
    35 	private byte[] byteData = null;
       
    36 	private boolean booleanData;
       
    37 	private String[] stringArrayData = null;
       
    38 	private String stringData = null;
       
    39 	private HTIMessage htiMessage = null;
       
    40 	private List<String> listData = null;
       
    41 	private AppStatus appStatus = null;
       
    42 	private HTIScreenMode screenMode = null;
       
    43 	private DriveInfo[] driveInfoData = null;
       
    44 	private HTIVersion versionData = null;
       
    45 	private FileInfo[] fileInfoData = null;
       
    46 	
       
    47 	//
       
    48 	// Constructors.
       
    49 	//
       
    50 
       
    51 	/**
       
    52 	 * Constructor for byte data.
       
    53 	 * @param byteData Data as bytes.
       
    54 	 */
       
    55 	public RequestResult(byte[] byteData){
       
    56 		this.byteData = byteData;
       
    57 	}
       
    58 
       
    59 	/**
       
    60 	 * Constructor for boolean data.
       
    61 	 * @param booleanData Boolean value..
       
    62 	 */
       
    63 	public RequestResult(boolean booleanData){
       
    64 		this.booleanData = booleanData;
       
    65 	}
       
    66 	
       
    67 	/**
       
    68 	 * Constructor for String array data.
       
    69 	 * @param stringData Data as String array.
       
    70 	 */
       
    71 	public RequestResult(String[] stringData){
       
    72 		this.stringArrayData = stringData;
       
    73 	}
       
    74 	
       
    75 	/**
       
    76 	 * Constructor for String data.
       
    77 	 * @param stringData Data as String.
       
    78 	 */
       
    79 	public RequestResult(String stringData){
       
    80 		this.stringData = stringData;
       
    81 	}
       
    82 	
       
    83 	/**
       
    84 	 * Constructor for HTIMessage.
       
    85 	 * @param htiMessage Result as HTIMessage.
       
    86 	 */
       
    87 	public RequestResult(HTIMessage htiMessage){
       
    88 		this.htiMessage = htiMessage;
       
    89 	}
       
    90 	
       
    91 	/**
       
    92 	 * Constructor for List.
       
    93 	 * @param listData Result as List.
       
    94 	 */
       
    95 	public RequestResult(List<String> listData){
       
    96 		this.listData = listData;
       
    97 	}
       
    98 	
       
    99 	/**
       
   100 	 * Constructor for AppStatus.
       
   101 	 * @param appStatus Application status.
       
   102 	 */
       
   103 	public RequestResult(AppStatus appStatus){
       
   104 		this.appStatus = appStatus;
       
   105 	}
       
   106 
       
   107 	/**
       
   108 	 * Constructor for screen mode.
       
   109 	 * @param screen mode Result as HTIScreenMode.
       
   110 	 */
       
   111 	public RequestResult(HTIScreenMode screenMode){
       
   112 		this.screenMode = screenMode;
       
   113 	}
       
   114 	
       
   115 	/**
       
   116 	 * Constructor for DriveInfo array data.
       
   117 	 * @param driveInfoData Data as DriveInfo array.
       
   118 	 */
       
   119 	public RequestResult(DriveInfo[] driveInfoData){
       
   120 		this.driveInfoData = driveInfoData;
       
   121 	}
       
   122 	
       
   123 	/**
       
   124 	 * Constructor for version data.
       
   125 	 * @param versionData Data as HTIVersion.
       
   126 	 */
       
   127 	public RequestResult(HTIVersion versionData){
       
   128 		this.versionData = versionData;
       
   129 	}
       
   130 
       
   131 	/**
       
   132 	 * Constructor for FileInfo array data.
       
   133 	 * @param versionData Data as FileInfo array.
       
   134 	 */
       
   135 	public RequestResult(FileInfo[] fileInfoData){
       
   136 		this.fileInfoData = fileInfoData;
       
   137 	}
       
   138 	
       
   139 	//
       
   140 	// Getters.
       
   141 	//
       
   142 	
       
   143 	/**
       
   144 	 * Method to get byte data result.
       
   145 	 * @return Data as bytes or null, if there is no byte data.
       
   146 	 */
       
   147 	public byte[] getByteData(){
       
   148 		return byteData ;
       
   149 	}
       
   150 	
       
   151 	/**
       
   152 	 * Method to get boolean data result.
       
   153 	 * @return Datavalue.
       
   154 	 */
       
   155 	public boolean getBooleanData(){
       
   156 		return booleanData ;
       
   157 	}
       
   158 	
       
   159 	/**
       
   160 	 * Method to get String array data result.
       
   161 	 * @return Data as String array or null, if there is no String array data.
       
   162 	 */
       
   163 	public String[] getStringArrayData(){
       
   164 		return stringArrayData ;
       
   165 	}
       
   166 	
       
   167 	/**
       
   168 	 * Method to get String data result.
       
   169 	 * @return Data as String or null, if there is no String data.
       
   170 	 */
       
   171 	public String getStringData(){
       
   172 		return stringData ;
       
   173 	}
       
   174 	
       
   175 	/**
       
   176 	 * Method to get HTIMessage result.
       
   177 	 * @return Data as HTIMessage or null, if there is no result.
       
   178 	 */
       
   179 	public HTIMessage getHTIMessage(){
       
   180 		return htiMessage ;
       
   181 	}
       
   182 	
       
   183 	/**
       
   184 	 * Method to get List result.
       
   185 	 * @return Data as List or null, if there is no result.
       
   186 	 */
       
   187 	public List<String> getListData(){
       
   188 		return listData ;
       
   189 	}
       
   190 	
       
   191 	/**
       
   192 	 * Method to get AppStatus result.
       
   193 	 * @return Data as AppStatus or null, if there is no result.
       
   194 	 */
       
   195 	public AppStatus getAppStatus(){
       
   196 		return appStatus ;
       
   197 	}
       
   198 
       
   199 	/**
       
   200 	 * Method to get screen mode result.
       
   201 	 * @return Data as HTIScreenMode or null, if there is no result.
       
   202 	 */
       
   203 	public HTIScreenMode getScreenMode() {
       
   204 		return screenMode;
       
   205 	}
       
   206 	
       
   207 	/**
       
   208 	 * Method to get DriveInfo array data result.
       
   209 	 * @return Data as DriveInfo array or null, if there is no DriveInfo array data.
       
   210 	 */
       
   211 	public DriveInfo[] getDriveInfoArrayData(){
       
   212 		return driveInfoData ;
       
   213 	}
       
   214 	
       
   215 	/**
       
   216 	 * Method to get HTIVersion data result.
       
   217 	 * @return Data as HTIVersion or null, if there is no HTIVersion data.
       
   218 	 */
       
   219 	public HTIVersion getHTIVersionData(){
       
   220 		return versionData ;
       
   221 	}
       
   222 	
       
   223 	/**
       
   224 	 * Method to get FileInfo array data result.
       
   225 	 * @return Data as FileInfo array or null, if there is no FileInfo array data.
       
   226 	 */
       
   227 	public FileInfo[] getFileInfoArrayData() {
       
   228 		return fileInfoData;
       
   229 	}
       
   230 }