<commit_before>package org.ndexbio.model.tools;

import java.util.ArrayList;
import java.util.List;

import org.ndexbio.model.object.SimplePropertyValuePair;

public class PropertyHelpers {

	public static List<SimplePropertyValuePair> copyProperties(List<SimplePropertyValuePair> properties) {
		List<SimplePropertyValuePair> copiedProperties = new ArrayList<SimplePropertyValuePair>();
		for (SimplePropertyValuePair prop : properties){
			if (null != prop){
				copiedProperties.add(copyProperty(prop));
			}
		}		
		return copiedProperties;
	}
	
	public static SimplePropertyValuePair copyProperty(SimplePropertyValuePair property){
		if (null == property) return null;
		SimplePropertyValuePair copiedProperty = new SimplePropertyValuePair();
		
		
		//private String _predicateString;
		if (null != property.getName()){
			copiedProperty.setName(new String(property.getName()));
		}
		
		//private String _value;
		if (null != property.getValue()){
			copiedProperty.setValue(new String(property.getValue()));
		}
		
		return copiedProperty;
		
	}

}
<commit_msg>added to property helpers<commit_after>package org.ndexbio.model.tools;

import java.util.ArrayList;
import java.util.List;

import org.ndexbio.model.object.SimplePropertyValuePair;

public class PropertyHelpers {

	public static List<SimplePropertyValuePair> copyProperties(List<SimplePropertyValuePair> properties) {
		List<SimplePropertyValuePair> copiedProperties = new ArrayList<SimplePropertyValuePair>();
		for (SimplePropertyValuePair prop : properties){
			if (null != prop){
				copiedProperties.add(copyProperty(prop));
			}
		}		
		return copiedProperties;
	}
	
	public static SimplePropertyValuePair copyProperty(SimplePropertyValuePair property){
		if (null == property) return null;
		SimplePropertyValuePair copiedProperty = new SimplePropertyValuePair();
		
		
		//private String _predicateString;
		if (null != property.getName()){
			copiedProperty.setName(new String(property.getName()));
		}
		
		//private String _value;
		if (null != property.getValue()){
			copiedProperty.setValue(new String(property.getValue()));
		}
		
		return copiedProperty;
		
	}
	
	public static void setProperty(
			String propertyString, 
			String valueString, 
			List<SimplePropertyValuePair> properties){
		
		// if the property is found in a pair in the list, set the value
		for (SimplePropertyValuePair pair : properties){
			if (propertyString.equals(pair.getName())){
				pair.setValue(valueString);
				return;
			}
		}
		
		// if the property is not found, add it
		addProperty(propertyString, valueString, properties);	
	}
	
	public static void addProperty(
			String propertyString, 
			String valueString, 
			List<SimplePropertyValuePair> properties){
		
		properties.add(new SimplePropertyValuePair(propertyString, valueString));		
	}

}

{'fraction_non_alphanumeric': 0.09702549575070822, 'fraction_numerical': 0.0, 'mean_word_length': 4.848861283643893, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '4737909', 'n_tokens_mistral': 887, 'n_tokens_neox': 767, 'n_words': 183}