src/main/java/org/tinyradius/packet/RadiusPacket.java
public static RadiusPacket createRadiusPacket(final int type) {
        RadiusPacket rp;
        switch (type) {
            case ACCESS_REQUEST:
                rp = new AccessRequest();
                break;

            case ACCOUNTING_REQUEST:
                rp = new AccountingRequest();
                break;

            case ACCESS_ACCEPT:
            case ACCESS_REJECT:
            case ACCOUNTING_RESPONSE:
            default:
                rp = new RadiusPacket();
        }

        rp.setPacketType(type);
        return rp;
    }
/**
     * Creates a RadiusPacket object. Depending on the passed type, the
     * appropiate successor is chosen. Sets the type, but does not touch
     * the packet identifier.
     *
     * @param type packet type
     * @return RadiusPacket object
     */
Creates a RadiusPacket object. Depending on the passed type, the
appropiate successor is chosen. Sets the type, but does not touch
the packet identifier.

@param type packet type
@return RadiusPacket object
Creates a RadiusPacket object . Depending on the passed type the appropiate successor is chosen . Sets the type but does not touch the packet identifier . @param type packet type @return RadiusPacket object
public static RadiusPacket createRadiusPacket(final int type) {
        RadiusPacket rp;
        switch (type) {
            case ACCESS_REQUEST:
                rp = new AccessRequest();
                break;
            case ACCOUNTING_REQUEST:
                rp = new AccountingRequest();
                break;
            case ACCESS_ACCEPT:
            case ACCESS_REJECT:
            case ACCOUNTING_RESPONSE:
            default:
                rp = new RadiusPacket();
        }
        rp.setPacketType(type);
        return rp;
    }
public static RadiusPacket createRadiusPacket ( final int type ) { RadiusPacket rp ; switch ( type ) { case ACCESS_REQUEST : rp = new AccessRequest ( ) ; break ; case ACCOUNTING_REQUEST : rp = new AccountingRequest ( ) ; break ; case ACCESS_ACCEPT : case ACCESS_REJECT : case ACCOUNTING_RESPONSE : default : rp = new RadiusPacket ( ) ; } rp . setPacketType ( type ) ; return rp ; }
Creates a RadiusPacket object.
Creates a RadiusPacket object .