package com.trimc.blogger.commons.type.adapter;

import com.trimc.blogger.commons.LogManager;
import com.trimc.blogger.commons.exception.AdapterValidationException;
import com.trimc.blogger.commons.type.EngGrammarUpperType;

public final class EngGrammarUpperTypeAdapter {

	public static LogManager logger = new LogManager(EngGrammarUpperTypeAdapter.class);

	public static EngGrammarUpperType findByAbbreviation(String tag) throws AdapterValidationException {
		tag = tag.toLowerCase();
		
		if ("n".equals(tag)) return EngGrammarUpperType.NOUN;
		else if ("v".equals(tag)) return EngGrammarUpperType.VERB;

		throw new AdapterValidationException("Unrecognized Abbreviation (tag = %s)", tag);
	}
}

@@ -42,16 +42,98 @@
 apter;%0A%0A
+import java.util.Arrays;%0Aimport java.util.Collection;%0Aimport java.util.Iterator;%0A%0A
 import c
@@ -564,18 +564,16 @@
 Case();%0A
-%09%09
 %0A%09%09if (%22
@@ -579,33 +579,36 @@
 %22n%22.equals(tag))
- 
+%0A%09%09%09
 return EngGramma
@@ -651,17 +651,20 @@
 ls(tag))
- 
+%0A%09%09%09
 return E
@@ -776,11 +776,493 @@
 tag);%0A%09%7D
+%0A%0A%09public static String toString(Collection%3CEngGrammarUpperType%3E engGrammarUpperTypes) %7B%0A%09%09StringBuilder sb = new StringBuilder();%0A%0A%09%09Iterator%3CEngGrammarUpperType%3E iter = engGrammarUpperTypes.iterator();%0A%09%09while (iter.hasNext()) %7B%0A%09%09%09sb.append(iter.next().toString());%0A%09%09%09if (iter.hasNext())%0A%09%09%09%09sb.append(%22, %22);%0A%09%09%7D%0A%0A%09%09return sb.toString();%0A%09%7D%0A%0A%09public static String toString(EngGrammarUpperType... engGrammarUpperTypes) %7B%0A%09%09return toString(Arrays.asList(engGrammarUpperTypes));%0A%09%7D
 %0A%7D%0A

improve eng grammar adapter to string methods