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

com.jwebmp.websockets.options.WebSocketMessageReceiver Maven / Gradle / Ivy

Go to download

Provides Asynchronous and Dynamic Log Handler support for JDK1.8 logging API. Access via LogFactory.

The newest version!
package com.jwebmp.websockets.options;

import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.jwebmp.core.htmlbuilder.javascript.JavaScriptPart;

import java.util.HashMap;
import java.util.Map;

import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.*;
import static com.fasterxml.jackson.annotation.JsonInclude.Include.*;

@JsonAutoDetect(fieldVisibility = ANY,
		getterVisibility = NONE,
		setterVisibility = NONE)
@JsonInclude(NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class WebSocketMessageReceiver>
		extends JavaScriptPart
{
	private WebSocketMessageReceiverActionType action;

	private Map data = new HashMap<>();

	public WebSocketMessageReceiver()
	{
		//No Config Required
	}

	public WebSocketMessageReceiver(WebSocketMessageReceiverActionType action, Map data)
	{
		this.action = action;
		this.data = data;
	}

	public WebSocketMessageReceiverActionType getAction()
	{
		return action;
	}

	@SuppressWarnings("unchecked")
	public J setAction(WebSocketMessageReceiverActionType action)
	{
		this.action = action;
		return (J) this;
	}

	public Map getData()
	{
		return data;
	}

	@SuppressWarnings("unchecked")
	public J setData(Map data)
	{
		this.data = data;
		return (J) this;
	}

	@JsonAnySetter
	public void add(String key, String value)
	{
		data.put(key, value);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy