/*
 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 * 
 * $Id: ListHashSetTextEncoder.java 73928 2014-08-01 09:35:37Z supol $
 */

package com.sun.ts.tests.websocket.ee.javax.websocket.session11.common;

import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;

import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;

public class ListHashSetTextEncoder implements
		Encoder.Text<LinkedList<HashSet<String>>> {

	@Override
	public void destroy() {
	}

	@Override
	public void init(EndpointConfig arg0) {
	}

	@Override
	public String encode(LinkedList<HashSet<String>> arg0) throws EncodeException {
		return listHashSetToString(arg0);
	}
	
	public static final String listHashSetToString(List<HashSet<String>> arg0) {
		return arg0.get(0).iterator().next();
	}

}
