Fork me on GitHub

CPD Results

The following document contains the results of PMD's CPD 6.13.0.

Duplications

File Line
fr/paris/lutece/plugins/identitystore/v3/web/rs/dto/common/AttributeType.java 44
fr/paris/lutece/plugins/identitystore/v3/web/rs/dto/contract/AttributeType.java 44
public enum AttributeType
{
    STRING( 0, "string" ),
    NUMERIC( 1, "numeric" ),
    FILE( 2, "file" ),
    DATE( 3, "date" ),
    ENUM( 4, "enum" );

    private static final Map<Integer, AttributeType> _mapKeyType = new HashMap<>( );
    private final int _nId;
    private final String _strCode;

    /**
     * private constructor
     *
     * @param nId
     *            id
     * @param strCode
     *            code
     */
    AttributeType( final int nId, final String strCode )
    {
        _nId = nId;
        _strCode = strCode;
    }

    static
    {
        for ( final AttributeType enumKeyType : values( ) )
        {
            _mapKeyType.put( enumKeyType._nId, enumKeyType );
        }
    }

    /**
     * returns id
     *
     * @return id
     */
    public int getId( )
    {
        return _nId;
    }

    /**
     * returns code
     *
     * @return code
     */
    public String getCode( )
    {
        return _strCode;
    }

    /**
     * returns KeyType enum for id
     *
     * @param nId
     *            id of KeyType
     * @return KeyType enum
     */
    public static AttributeType valueOf( int nId )
    {
        return _mapKeyType.get( nId );
    }

}
File Line
fr/paris/lutece/plugins/identitystore/v3/web/rs/IdentityRequestValidator.java 224
fr/paris/lutece/plugins/identitystore/v3/web/rs/IdentityRequestValidator.java 266
    public void checkMergeRequest( IdentityMergeRequest identityMergeRequest ) throws IdentityStoreException
    {
        if ( identityMergeRequest == null )
        {
            throw new IdentityStoreException( "Provided Identity Merge request is null" );
        }

        if ( identityMergeRequest.getPrimaryCuid( ) == null )
        {
            throw new IdentityStoreException( "An Identity merge request must provide the CUID of the primary Identity" );
        }

        if ( identityMergeRequest.getSecondaryCuid( ) == null )
        {
            throw new IdentityStoreException( "An Identity merge request must provide the CUID of the secondary Identity" );
        }

        if ( identityMergeRequest.getPrimaryLastUpdateDate( ) == null )
        {
            throw new IdentityStoreException( "An Identity merge request must provide the last update date of the primary Identity" );
        }

        if ( identityMergeRequest.getSecondaryLastUpdateDate( ) == null )
        {
            throw new IdentityStoreException( "An Identity merge request must provide the last update date of the secondary Identity" );
        }

        if ( identityMergeRequest.getIdentity( ) != null