<commit_before>/*
 * Copyright (c) OSGi Alliance (2012, 2014). All Rights Reserved.
 *
 * 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 org.osgi.framework.dto;

import java.util.Map;
import org.osgi.dto.DTO;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;

/**
 * Data Transfer Object for a ServiceReference.
 * 
 * <p>
 * {@code ServiceReferenceDTO}s for all registered services can be obtained from
 * a {@link FrameworkDTO}. An installed Bundle can be adapted to provide a
 * {@code ServiceReferenceDTO[]} of the services registered by the Bundle. A
 * {@code ServiceReferenceDTO} obtained from a framework must convert service
 * property values which are not valid value types for DTOs to type
 * {@code String} using {@code String.valueOf(Object)}.
 * 
 * @author $Id$
 * @NotThreadSafe
 */
public class ServiceReferenceDTO extends DTO {
    /**
	 * The id of the service.
	 * 
	 * @see Constants#SERVICE_ID
	 */
    public long                id;

    /**
	 * The id of the bundle that registered the service.
	 * 
	 * @see ServiceReference#getBundle()
	 */<commit_msg>Bug 2735: ServiceReferenceDTO[] must be null for stopped bundle<commit_after>/*
 * Copyright (c) OSGi Alliance (2012, 2014). All Rights Reserved.
 *
 * 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 org.osgi.framework.dto;

import java.util.Map;
import org.osgi.dto.DTO;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;

/**
 * Data Transfer Object for a ServiceReference.
 * 
 * <p>
 * {@code ServiceReferenceDTO}s for all registered services can be obtained from
 * a {@link FrameworkDTO}. A started Bundle can be adapted to provide a
 * {@code ServiceReferenceDTO[]} of the services registered by the Bundle. A
 * {@code ServiceReferenceDTO} obtained from a framework must convert service
 * property values which are not valid value types for DTOs to type
 * {@code String} using {@code String.valueOf(Object)}.
 * 
 * @author $Id$
 * @NotThreadSafe
 */
public class ServiceReferenceDTO extends DTO {
    /**
	 * The id of the service.
	 * 
	 * @see Constants#SERVICE_ID
	 */
    public long                id;

    /**
	 * The id of the bundle that registered the service.
	 * 
	 * @see ServiceReference#getBundle()
	 */
{'fraction_non_alphanumeric': 0.08925869894099848, 'fraction_numerical': 0.008472012102874432, 'mean_word_length': 3.5852981969486826, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5712910', 'n_tokens_mistral': 918, 'n_tokens_neox': 876, 'n_words': 392}