<commit_before>package org.jscsi.target.settings;

/**
 * Instances of this class contain all session-wide and connection-specific
 * parameters that are either declared by the initiator or negotiated in the
 * text parameter negotiation stages.
 * 
 * @author <NAME>
 */
public final class Settings {

    /**
     * The {@link #settingsId} variable allows to compare the age of different {@link Settings} objects -
     * newer instances have a higher {@link #settingsId}.
     * <p>
     * What it is really used for, however, is for determining if the buffered {@link Settings} object, which
     * can be accessed via {@link ConnectionSettingsNegotiator#getSettings()} is up to date or if it has to be
     * replaced.
     * 
     * @see ConnectionSettingsNegotiator#getSettings()
     * @see SessionSettingsNegotiator#getCurrentSettingsId()
     */
    private final long settingsId;

    // connection parameters
    /**
     * The <code>DataDigest</code> parameter.
     */
    private String dataDigest;

    /**
     * The <code>HeaderDigest</code> parameter.
     */
    private String headerDigest;

    /**
     * The <code>IFMarker</code> parameter.
     */
    private Boolean ifMarker;

    /**
     * The <code>IFMarkInt</code> parameter.
     */
    private Integer ifMarkInt;

    /**
     * The <code>MaxRecvDataSegmentLength</code> parameter.
     */
    private Integer maxRecvDataSegmentLength;

    /**
     * The <code>OFMarker</code> parameter.
     */
    private Boolean ofMarker;

    /**
     * The <code>OFMarkInt</code> parameter.
     */
    private Integer ofMarkInt;

    // session parameters

    /**
     * The <code>TargetName</code> parameter
     */
    private String targetName;

    /**
     * The <code>DataPDUInOrder</code> parameter.
     */
    private Boolean dataPduInOrder;

    /**
     * The <code>DataSequenceInOrder</code> parameter.
     */
    private Boolean dataSequenceInOrder;

    /**
     * The <code>DefaultTime2Retain</code> parameter.
     */
    private Integer defaultTime2Retain;

    /**
     * The <code>DefaultTime2Wait</code> parameter.
     */
    private Integer defaultTime2Wait;

    /**
     * The <code>ErrorRecoveryLevel</code> parameter.
     */
    private Integer errorRecoveryLevel;

    /**
     * The <code>FirstBurstLength</code> parameter.
     */
    private Integer firstBurstLength;

    /**
     * The <code>ImmediateData</code> parameter.
     */
    private Boolean immediateData;

    /**
     * The <code>InitialR2T</code> parameter.
     */
    private Boolean initialR2T;

    /**
     * The <code>InitiatorAlias</code> parameter.
     */
    private String initiatorAlias;

    /**
     * The <code>InitiatorName</code> parameter.
     */
    private String initiatorName;

    /**
     * The <code>MaxBurstLength</code> parameter.
     */
    private Integer maxBurstLength;

    /**
     * The <code>MaxConnections</code> parameter.
     */
    private Integer maxConnections;

    /**
     * The <code>MaxOutstandingR2T</code> parameter.
     */
    private Integer maxOutstandingR2T;

    /**
     * The <code>SessionType</code> parameter.
     */
    private String sessionType;

    /**
     * Throws a {@link SettingsException} if the parameter is <code>null</code>.
     * 
     * @param member
     *            the member variable to check
     * @throws SettingsException
     *             if the parameter is <code>null</code>
     */
    private static void checkIfNull(Object member) throws SettingsException {
        if (member == null)
            throw new SettingsException();
    }

    /**
     * The constructor based on the builder pattern.
     * 
     * @param c
     *            {@link ConnectionSettingsBuilderComponent} with the current
     *            connection-specific parameters
     * @param s
     *            {@link SessionSettingsBuilderComponent} with the current
     *            session-wide parameters
     */
    Settings(final ConnectionSettingsBuilderComponent c, final SessionSettingsBuilderComponent s) {
        settingsId = s.settingsId;
        // connection parameters
        dataDigest = c.dataDigest;
        headerDigest = c.headerDigest;<commit_msg>OPEN - task 5: Cleaning up the code  http://github.com/disy/jSCSI/issues/issue/5<commit_after>package org.jscsi.target.settings;

/**
 * Instances of this class contain all session-wide and connection-specific
 * parameters that are either declared by the initiator or negotiated in the
 * text parameter negotiation stages.
 * 
 * @author <NAME>
 */
public final class Settings {

    /**
     * The {@link #settingsId} variable allows to compare the age of different {@link Settings} objects -
     * newer instances have a higher {@link #settingsId}.
     * <p>
     * What it is really used for, however, is for determining if the buffered {@link Settings} object, which
     * can be accessed via {@link ConnectionSettingsNegotiator#getSettings()} is up to date or if it has to be
     * replaced.
     * 
     * @see ConnectionSettingsNegotiator#getSettings()
     * @see SessionSettingsNegotiator#getCurrentSettingsId()
     */
    private final long settingsId;

    // connection parameters
    /**
     * The <code>DataDigest</code> parameter.
     */
    private final String dataDigest;

    /**
     * The <code>HeaderDigest</code> parameter.
     */
    private final String headerDigest;

    /**
     * The <code>IFMarker</code> parameter.
     */
    private final Boolean ifMarker;

    /**
     * The <code>IFMarkInt</code> parameter.
     */
    private final Integer ifMarkInt;

    /**
     * The <code>MaxRecvDataSegmentLength</code> parameter.
     */
    private final Integer maxRecvDataSegmentLength;

    /**
     * The <code>OFMarker</code> parameter.
     */
    private final Boolean ofMarker;

    /**
     * The <code>OFMarkInt</code> parameter.
     */
    private final Integer ofMarkInt;

    // session parameters

    /**
     * The <code>TargetName</code> parameter
     */
    private final String targetName;

    /**
     * The <code>DataPDUInOrder</code> parameter.
     */
    private final Boolean dataPduInOrder;

    /**
     * The <code>DataSequenceInOrder</code> parameter.
     */
    private final Boolean dataSequenceInOrder;

    /**
     * The <code>DefaultTime2Retain</code> parameter.
     */
    private final Integer defaultTime2Retain;

    /**
     * The <code>DefaultTime2Wait</code> parameter.
     */
    private final Integer defaultTime2Wait;

    /**
     * The <code>ErrorRecoveryLevel</code> parameter.
     */
    private final Integer errorRecoveryLevel;

    /**
     * The <code>FirstBurstLength</code> parameter.
     */
    private final Integer firstBurstLength;

    /**
     * The <code>ImmediateData</code> parameter.
     */
    private final Boolean immediateData;

    /**
     * The <code>InitialR2T</code> parameter.
     */
    private final Boolean initialR2T;

    /**
     * The <code>InitiatorAlias</code> parameter.
     */
    private final String initiatorAlias;

    /**
     * The <code>InitiatorName</code> parameter.
     */
    private final String initiatorName;

    /**
     * The <code>MaxBurstLength</code> parameter.
     */
    private final Integer maxBurstLength;

    /**
     * The <code>MaxConnections</code> parameter.
     */
    private final Integer maxConnections;

    /**
     * The <code>MaxOutstandingR2T</code> parameter.
     */
    private final Integer maxOutstandingR2T;

    /**
     * The <code>SessionType</code> parameter.
     */
    private final String sessionType;

    /**
     * Throws a {@link SettingsException} if the parameter is <code>null</code>.
     * 
     * @param member
     *            the member variable to check
     * @throws SettingsException
     *             if the parameter is <code>null</code>
     */
    private static void checkIfNull(Object member) throws SettingsException {
        if (member == null)
            throw new SettingsException();
    }

    /**
     * The constructor based on the builder pattern.
     * 
     * @param c
     *            {@link ConnectionSettingsBuilderComponent} with the current
     *            connection-specific parameters
     * @param s
     *            {@link SessionSettingsBuilderComponent} with the current
     *            session-wide parameters
     */
    Settings(final ConnectionSettingsBuilderComponent c, final SessionSettingsBuilderComponent s) {
        settingsId = s.settingsId;
        // connection parameters
        dataDigest = c.dataDigest;
        headerDigest = c.headerDigest;
{'fraction_non_alphanumeric': 0.10360830722821673, 'fraction_numerical': 0.002088409328228333, 'mean_word_length': 2.371138052405162, 'pattern_counts': {'":': 0, '<': 103, '<?xml version=': 0, '>': 103, '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': '3110030', 'n_tokens_mistral': 2386, 'n_tokens_neox': 2319, 'n_words': 644}