<commit_before>/* 
 * Copyright 2014 MICRORISC s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.microrisc.simply.iqrf.dpa.v210;

import com.microrisc.simply.StandardServicesDeviceObject;
import com.microrisc.simply.ConnectorService;
import com.microrisc.simply.CallRequestProcessingInfoContainer;
import com.microrisc.simply.iqrf.dpa.v210.di_services.DPA_StandardServices;
import com.microrisc.simply.iqrf.dpa.v210.types.DPA_AdditionalInfo;
import java.util.UUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Device Object for DPA specific needs.
 * 
 * @author <NAME>
 */
public class DPA_DeviceObject 
extends StandardServicesDeviceObject 
implements DPA_StandardServices {
    /** Logger. */
    private static final Logger logger = LoggerFactory.getLogger(DPA_DeviceObject.class);
    
    /** Default request HW profile. */
    public static final int DEFAULT_REQUEST_HW_PROFILE = 0xFFFF;
    
    /** Request HW profile. */
    private int requestHwProfile = DEFAULT_REQUEST_HW_PROFILE;
    
    
    private int checkRequestHwProfile( int requestHwProfile ) {
        if ( (requestHwProfile < 0x0000) || (requestHwProfile > 0xFFFF) ) {
            throw new IllegalArgumentException("Invalid value of request HW profile: " + requestHwProfile);
        }
        return requestHwProfile;
    }
    
    
    public DPA_DeviceObject(String networkId, String nodeId, ConnectorService connector, 
            CallRequestProcessingInfoContainer resultsContainer
    ) {
        super(networkId, nodeId, connector, resultsContainer);
    }
    
    @Override
    public void setRequestHwProfile(int requestHwProfile) {
        this.requestHwProfile = checkRequestHwProfile( requestHwProfile );
    }
    
    @Override<commit_msg>simply-iqrf-dpa-v210: - tiny change in checking of request's HW profile during creation of   DPA Device Object<commit_after>/* 
 * Copyright 2014 MICRORISC s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.microrisc.simply.iqrf.dpa.v210;

import com.microrisc.simply.StandardServicesDeviceObject;
import com.microrisc.simply.ConnectorService;
import com.microrisc.simply.CallRequestProcessingInfoContainer;
import com.microrisc.simply.iqrf.dpa.v210.di_services.DPA_StandardServices;
import com.microrisc.simply.iqrf.dpa.v210.types.DPA_AdditionalInfo;
import java.util.UUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Device Object for DPA specific needs.
 * 
 * @author <NAME>
 */
public class DPA_DeviceObject 
extends StandardServicesDeviceObject 
implements DPA_StandardServices {
    /** Logger. */
    private static final Logger logger = LoggerFactory.getLogger(DPA_DeviceObject.class);
    
    /** Default request HW profile. */
    public static final int DEFAULT_REQUEST_HW_PROFILE = 0xFFFF;
    
    /** Request HW profile. */
    private int requestHwProfile = DEFAULT_REQUEST_HW_PROFILE;
    
    
    private static int checkRequestHwProfile( int requestHwProfile ) {
        if ( (requestHwProfile < 0x0000) || (requestHwProfile > 0xFFFF) ) {
            throw new IllegalArgumentException("Invalid value of request HW profile: " + requestHwProfile);
        }
        return requestHwProfile;
    }
    
    
    public DPA_DeviceObject(String networkId, String nodeId, ConnectorService connector, 
            CallRequestProcessingInfoContainer resultsContainer
    ) {
        super(networkId, nodeId, connector, resultsContainer);
    }
    
    @Override
    public void setRequestHwProfile(int requestHwProfile) {
        this.requestHwProfile = checkRequestHwProfile( requestHwProfile );
    }
    
    @Override
{'fraction_non_alphanumeric': 0.07787762088147197, 'fraction_numerical': 0.01176722293538725, 'mean_word_length': 3.6517412935323383, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5017468', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1318, 'n_words': 380}