package org.handlersocket;

import java.util.ArrayList;
import java.util.List;

/**
 * HandlerSocketのコマンド実行結果を表現するクラスです
 * @author moaikids
 *
 */
public class HandlerSocketResult {
	private int status;//ステータスコード
	private int fieldNum;//返却されたメッセージの数
	private byte[] messages;//メッセージ

	public HandlerSocketResult(){
		super();
	}
	
	public HandlerSocketResult(int status, int fieldNum, byte[] messages){
		this();
		this.status = status;
		this.fieldNum = fieldNum;
		this.messages = messages;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getFieldNum() {
		return fieldNum;
	}

	public void setFieldNum(int fieldNum) {
		this.fieldNum = fieldNum;
	}

	public byte[] getMessages() {
		return messages;
	}

	public void setMessages(byte[] messages) {
		this.messages = messages;
	}
	
	@Override
	public String toString(){
		StringBuilder builder = new StringBuilder();
		builder.append(status).append("\t");
		builder.append(fieldNum).append("\t");
		builder.append(new String(messages)).append("\t");
		
		return builder.toString();
	}
}

@@ -175,17 +175,20 @@
 esult %7B%0A
-%09
+    
 private 
@@ -209,17 +209,20 @@
 %E3%83%86%E3%83%BC%E3%82%BF%E3%82%B9%E3%82%B3%E3%83%BC%E3%83%89%0A
-%09
+    
 private 
@@ -253,17 +253,20 @@
 %E3%82%B8%E3%81%AE%E6%95%B0%0A
-%09
+    
 private 
 byte
@@ -261,22 +261,28 @@
 private 
+List%3C
 byte%5B%5D
+%3E
  message
@@ -292,17 +292,20 @@
 /%E3%83%A1%E3%83%83%E3%82%BB%E3%83%BC%E3%82%B8%0A%0A
-%09
+    
 public H
@@ -326,18 +326,24 @@
 sult()%7B%0A
-%09%09
+        
 super();
@@ -343,22 +343,31 @@
 uper();%0A
-%09%7D%0A%09%0A%09
+    %7D%0A    %0A    
 public H
@@ -411,22 +411,28 @@
 eldNum, 
+List%3C
 byte%5B%5D
+%3E
  message
@@ -439,20 +439,32 @@
 s)%7B%0A
-%09%09this();%0A%09%09
+        this();%0A        
 this
@@ -481,18 +481,24 @@
 status;%0A
-%09%09
+        
 this.fie
@@ -515,18 +515,24 @@
 eldNum;%0A
-%09%09
+        
 this.mes
@@ -545,29 +545,35 @@
 = messages;%0A
-%09%7D%0A%0A%09
+    %7D%0A%0A    
 public int g
@@ -581,26 +581,32 @@
 tStatus() %7B%0A
-%09%09
+        
 return statu
@@ -604,29 +604,35 @@
 urn status;%0A
-%09%7D%0A%0A%09
+    %7D%0A%0A    
 public void 
@@ -651,26 +651,32 @@
 t status) %7B%0A
-%09%09
+        
 this.status 
@@ -685,21 +685,27 @@
 status;%0A
-%09%7D%0A%0A%09
+    %7D%0A%0A    
 public i
@@ -719,26 +719,32 @@
 ieldNum() %7B%0A
-%09%09
+        
 return field
@@ -744,29 +744,35 @@
 n fieldNum;%0A
-%09%7D%0A%0A%09
+    %7D%0A%0A    
 public void 
@@ -795,26 +795,32 @@
 fieldNum) %7B%0A
-%09%09
+        
 this.fieldNu
@@ -837,26 +837,38 @@
 um;%0A
-%09%7D%0A%0A%09
+    %7D%0A%0A    
 public 
+List%3C
 byte%5B%5D
+%3E
  get
@@ -880,18 +880,24 @@
 ges() %7B%0A
-%09%09
+        
 return m
@@ -909,13 +909,19 @@
 es;%0A
-%09%7D%0A%0A%09
+    %7D%0A%0A    
 publ
@@ -940,22 +940,28 @@
 essages(
+List%3C
 byte%5B%5D
+%3E
  message
@@ -965,18 +965,24 @@
 ages) %7B%0A
-%09%09
+        
 this.mes
@@ -1003,14 +1003,23 @@
 es;%0A
-%09%7D%0A%09%0A%09
+    %7D%0A    %0A    
 @Ove
@@ -1024,17 +1024,20 @@
 verride%0A
-%09
+    
 public S
@@ -1054,18 +1054,24 @@
 ring()%7B%0A
-%09%09
+        
 StringBu
@@ -1107,18 +1107,24 @@
 lder();%0A
-%09%09
+        
 builder.
@@ -1144,34 +1144,40 @@
 ).append(%22%5Ct%22);%0A
-%09%09
+        
 builder.append(f
@@ -1199,18 +1199,69 @@
 (%22%5Ct%22);%0A
-%09%09
+        for (byte%5B%5D message : messages) %0A            
 builder.
@@ -1285,17 +1285,16 @@
 (message
-s
 )).appen
@@ -1306,13 +1306,25 @@
 %22);%0A
-%09%09%0A%09%09
+        %0A        
 retu
@@ -1350,9 +1350,12 @@
 ();%0A
-%09
+    
 %7D%0A%7D%0A

format bug fix