<commit_before>package org.menacheri.communication;

import java.net.SocketAddress;

import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.socket.DatagramChannel;

public class NettyUDPMessage implements INettyMessage
{
	private ChannelBuffer buffer;
	private DatagramChannel channel;
	private SocketAddress remoteAddress;
	private static final int deliveryGuaranty = DeliveryGuaranty.FAST;
	
	public NettyUDPMessage()
	{
		
	}
	
	@Override
	public ChannelBuffer getMessage()
	{
		return buffer;
	}
	
	@Override
	public ChannelBuffer getChannelBuffer()
	{
		return buffer;
	}
	
	@Override
	public Channel getChannel()
	{
		return channel;
	}

	@Override
	public SocketAddress getSocketAddress()
	{
		return remoteAddress;
	}

	@Override
	public INettyMessage setChannel(Channel channel)
	{
		this.channel = (DatagramChannel)channel;
		return this;
		
	}

	@Override
	public INettyMessage setChannelBuffer(ChannelBuffer buffer)
	{
		this.buffer = buffer;
		return this;
	}

	@Override
	public INettyMessage setSocketAddress(SocketAddress remoteAddress)<commit_msg>This class is UDP specific hence it is returning Netty DatagramChannel instead of Channel, this prevents a cast.<commit_after>package org.menacheri.communication;

import java.net.SocketAddress;

import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.socket.DatagramChannel;

public class NettyUDPMessage implements INettyMessage
{
	private ChannelBuffer buffer;
	private DatagramChannel channel;
	private SocketAddress remoteAddress;
	private static final int deliveryGuaranty = DeliveryGuaranty.FAST;
	
	public NettyUDPMessage()
	{
		
	}
	
	@Override
	public ChannelBuffer getMessage()
	{
		return buffer;
	}
	
	@Override
	public ChannelBuffer getChannelBuffer()
	{
		return buffer;
	}
	
	@Override
	public DatagramChannel getChannel()
	{
		return channel;
	}

	@Override
	public SocketAddress getSocketAddress()
	{
		return remoteAddress;
	}

	@Override
	public INettyMessage setChannel(Channel channel)
	{
		this.channel = (DatagramChannel)channel;
		return this;
		
	}

	@Override
	public INettyMessage setChannelBuffer(ChannelBuffer buffer)
	{
		this.buffer = buffer;
		return this;
	}

	@Override
	public INettyMessage setSocketAddress(SocketAddress remoteAddress)
{'fraction_non_alphanumeric': 0.07127704709376326, 'fraction_numerical': 0.0, 'mean_word_length': 5.030690537084399, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6204339', 'n_tokens_mistral': 777, 'n_tokens_neox': 712, 'n_words': 174}