<commit_before>package cuz.my.psmm;

import cuz.my.psmm.data.Data;

/**
 * An abstract class that has message creation methods and the definition of
 * message type.
 * <p>
 * There are several message interfaces<br>
 * {@link UMessage} only accept primitives and Strings, which ensures its data's
 * immutability. However bad {@link Data} implementation could violate it.<br>
 * {@link TMessage} gives flexibility to data carried, but you have to be very
 * careful designing your message, since TypedMessage doesn't check the
 * mutability of the datum you set in.
 * 
 * @author cuzfrog
 *
 */
public abstract class Messages implements MessageCommonInterface {

	/**
	 * Message types indicating the structures of messages.
	 * 
	 * @author cuzfrog
	 *
	 */
	public static enum Style {
		LINKED_MAP {
			@Override
			public String toString() {
				return "UncachedLinkedMap";
			}
		},
		FLAT_MAP {
			@Override
			public String toString() {
				return "UncachedFlatMap";
			}
		},
		CACHED_LINKED_MAP {
			@Override
			public String toString() {
				return "CachedLinkedMap";
			}
		},
		CACHED_FLAT_MAP {
			@Override
			public String toString() {
				return "CachedFlatMap";
			}
		};

		boolean isCached(){
			return this.toString().contains("CACHED");
		}
	}

	/**
	 * Create a new {@link UntypedRawMessage}.
	 * <p>
	 * There are several {@link Messages.Style}s of message you can choose for<commit_msg>refined enum Messages.Style<commit_after>package cuz.my.psmm;

import cuz.my.psmm.data.Data;

/**
 * An abstract class that has message creation methods and the definition of
 * message type.
 * <p>
 * There are several message interfaces<br>
 * {@link UMessage} only accept primitives and Strings, which ensures its data's
 * immutability. However bad {@link Data} implementation could violate it.<br>
 * {@link TMessage} gives flexibility to data carried, but you have to be very
 * careful designing your message, since TypedMessage doesn't check the
 * mutability of the datum you set in.
 * 
 * @author cuzfrog
 *
 */
public abstract class Messages implements MessageCommonInterface {

	/**
	 * Message types indicating the structures of messages.
	 * 
	 * @author cuzfrog
	 *
	 */
	public static enum Style {
		LINKED_MAP ,
		FLAT_MAP ,
		CACHED_LINKED_MAP ,
		CACHED_FLAT_MAP ;

		private boolean isCached;
		private String name;
				
		private Style(){
			this.isCached=this.toString().contains("CACHED");
			this.initiateName();
		}
		
		private void initiateName(){
			StringBuilder nameBuilder=new StringBuilder();
			String originalName=this.toString();
			if(originalName.contains("CACHED")){
				nameBuilder.append("Cached");
			}else{
				nameBuilder.append("Uncached");
			} //creation attribute
			
			if(originalName.contains("LINKED")){
				nameBuilder.append("Linked");
			}else if(originalName.contains("FLAT")){
				nameBuilder.append("Flat");
			} //structure attribute
			
			if(originalName.contains("MAP")){
				nameBuilder.append("Map");
			} //data attribute
			
			this.name=nameBuilder.toString();
		}
		
		boolean isCached(){
			return this.isCached;
		}
		
		@Override
		public String toString(){
			return name;
		}
	}

	/**
	 * Create a new {@link UntypedRawMessage}.
	 * <p>
	 * There are several {@link Messages.Style}s of message you can choose for
{'fraction_non_alphanumeric': 0.10737033666969972, 'fraction_numerical': 0.0, 'mean_word_length': 3.5489655172413794, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1213362', 'n_tokens_mistral': 1138, 'n_tokens_neox': 979, 'n_words': 305}