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

org.littleshoot.stun.stack.message.NullStunMessage Maven / Gradle / Ivy

The newest version!
package org.littleshoot.stun.stack.message;

import java.util.Collections;
import java.util.Map;

import org.apache.commons.id.uuid.UUID;
import org.littleshoot.stun.stack.message.attributes.StunAttribute;
import org.littleshoot.stun.stack.message.attributes.StunAttributeType;

/**
 * Placeholder class that forces callers to handle cases such as when there
 * is no response to a request. 
 */
public class NullStunMessage implements StunMessage
    {

    public Map getAttributes()
        {
        return Collections.emptyMap();
        }

    public int getBodyLength()
        {
        return 0;
        }

    public int getTotalLength()
        {
        return 0;
        }

    public UUID getTransactionId()
        {
        return UUID.randomUUID();
        }

    public StunMessageType getType()
        {
        return null;
        }

    public  T accept(final StunMessageVisitor visitor)
        {
        return visitor.visitNullMessage(this);
        }

    }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy