/* * [Changes.java] * * Summary: Enum for various states a file can be in vis a vis has it really changed or not. * * Copyright: (c) 2006-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.4 2006-03-13 */ package com.mindprod.untouch; /** * Enum for various states a file can be in vis a vis has it really changed or not. * * @author Roedy Green, Canadian Mind Products * @version 1.4 2006-03-13 * @since 2006-03-13 */ public enum Changes { // do not disturb order. It is the order of the legend. /** * File unchanged in all respects. */ UNCHANGED( '-', "There was no change of any kind to the file; shown only in untouch.log." ), /** * file's length changed. */ LENGTH_CHANGED( '+', "File's length changed." ), /** * Date on file changed but contents did not, will be reverted. */ CONTENTS_UNCHANGED( '^', "Untouch reverted the file to its old last-modified date/time." ), /** * new file not seen before. */ NEW( '!', "File is new, at least to Untouch." ), /** * file's contents changed but not length */ CONTENTS_CHANGED( '*', "File's contents changed, but it did not change length." ), /** * file ignored because it is locked or otherwise not readable. */ IGNORING( 'x', "File was locked and/or ignored." ); private final String description; private final char code; /** * count of how many files in this category */ private int count = 0; /** * 8construcotor * * @param code 1-letter code to represent this state. */ private Changes( final char code, final String description ) { this.code = code; this.description = description; } /** * get count of how many files in this category. * * @return count of how many files in this category. */ int getCount() { return count; } /** * add 1 to count of files in this category */ void incrementCount() { count++; } /** * Get code for the enum. * * @return 1-letter code corresponding to this enum */ public char getCode() { return code; } /** * get descption of this category * * @return category description */ public String getDescription() { return description; } }