Home / Class/ DefaultSmtpRequest Class — netty Architecture

DefaultSmtpRequest Class — netty Architecture

Architecture documentation for the DefaultSmtpRequest class in DefaultSmtpRequest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  6d4071fb_b30e_244a_aab3_caa71bae58ed["DefaultSmtpRequest"]
  365900ee_596b_9da2_c4c5_11029545cd13["DefaultSmtpRequest.java"]
  6d4071fb_b30e_244a_aab3_caa71bae58ed -->|defined in| 365900ee_596b_9da2_c4c5_11029545cd13
  f9728950_8058_4616_972c_1e5950cd2cf1["DefaultSmtpRequest()"]
  6d4071fb_b30e_244a_aab3_caa71bae58ed -->|method| f9728950_8058_4616_972c_1e5950cd2cf1
  1528639f_ad3e_b0b2_d529_76ef1483ea62["SmtpCommand()"]
  6d4071fb_b30e_244a_aab3_caa71bae58ed -->|method| 1528639f_ad3e_b0b2_d529_76ef1483ea62
  b746c2ba_5441_dad7_1f0c_ccabcc56d48f["parameters()"]
  6d4071fb_b30e_244a_aab3_caa71bae58ed -->|method| b746c2ba_5441_dad7_1f0c_ccabcc56d48f
  f9bee075_6d2d_8d47_e7fb_c2fe357eba3d["hashCode()"]
  6d4071fb_b30e_244a_aab3_caa71bae58ed -->|method| f9bee075_6d2d_8d47_e7fb_c2fe357eba3d
  a7a7a5a8_1d42_7c9a_fad5_419d7a74aa4e["equals()"]
  6d4071fb_b30e_244a_aab3_caa71bae58ed -->|method| a7a7a5a8_1d42_7c9a_fad5_419d7a74aa4e
  07882e95_3df9_86c4_57ea_6374d0d79e7f["String()"]
  6d4071fb_b30e_244a_aab3_caa71bae58ed -->|method| 07882e95_3df9_86c4_57ea_6374d0d79e7f

Relationship Graph

Source Code

codec-smtp/src/main/java/io/netty/handler/codec/smtp/DefaultSmtpRequest.java lines 27–102

@UnstableApi
public final class DefaultSmtpRequest implements SmtpRequest {

    private final SmtpCommand command;
    private final List<CharSequence> parameters;

    /**
     * Creates a new instance with the given command and no parameters.
     */
    public DefaultSmtpRequest(SmtpCommand command) {
        this.command = ObjectUtil.checkNotNull(command, "command");
        parameters = Collections.emptyList();
    }

    /**
     * Creates a new instance with the given command and parameters.
     */
    public DefaultSmtpRequest(SmtpCommand command, CharSequence... parameters) {
        this.command = ObjectUtil.checkNotNull(command, "command");
        SmtpUtils.validateSMTPParameters(parameters);
        this.parameters = SmtpUtils.toUnmodifiableList(parameters);
    }

    /**
     * Creates a new instance with the given command and parameters.
     */
    public DefaultSmtpRequest(CharSequence command, CharSequence... parameters) {
        this(SmtpCommand.valueOf(command), parameters);
    }

    DefaultSmtpRequest(SmtpCommand command, List<CharSequence> parameters) {
        this.command = ObjectUtil.checkNotNull(command, "command");
        SmtpUtils.validateSMTPParameters(parameters);
        this.parameters = parameters != null ?
                Collections.unmodifiableList(parameters) : Collections.<CharSequence>emptyList();
    }

    @Override
    public SmtpCommand command() {
        return command;
    }

    @Override
    public List<CharSequence> parameters() {
        return parameters;
    }

    @Override
    public int hashCode() {
        return command.hashCode() * 31 + parameters.hashCode();
    }

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof DefaultSmtpRequest)) {
            return false;
        }

        if (o == this) {
            return true;
        }

        DefaultSmtpRequest other = (DefaultSmtpRequest) o;

        return command().equals(other.command()) &&
                parameters().equals(other.parameters());
    }

    @Override
    public String toString() {
        return "DefaultSmtpRequest{" +
                "command=" + command +
                ", parameters=" + parameters +
                '}';
    }
}

Frequently Asked Questions

What is the DefaultSmtpRequest class?
DefaultSmtpRequest is a class in the netty codebase, defined in codec-smtp/src/main/java/io/netty/handler/codec/smtp/DefaultSmtpRequest.java.
Where is DefaultSmtpRequest defined?
DefaultSmtpRequest is defined in codec-smtp/src/main/java/io/netty/handler/codec/smtp/DefaultSmtpRequest.java at line 27.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free