This backward IMO and an anti-pattern: an interface should only define a 
contract for a service, not constants. 

Gary

-------- Original message --------
From: ebo...@apache.org 
Date:11/28/2013  05:41  (GMT-05:00) 
To: comm...@commons.apache.org 
Subject: svn commit: r1546339 -
  
/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmConstants.java
 

Author: ebourg
Date: Thu Nov 28 10:41:37 2013
New Revision: 1546339

URL: http://svn.apache.org/r1546339
Log:
Turn PnmConstants into an interface and make it package private

Modified:
    
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmConstants.java

Modified: 
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmConstants.java
URL: 
http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmConstants.java?rev=1546339&r1=1546338&r2=1546339&view=diff
==============================================================================
--- 
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmConstants.java
 (original)
+++ 
commons/proper/imaging/trunk/src/main/java/org/apache/commons/imaging/formats/pnm/PnmConstants.java
 Thu Nov 28 10:41:37 2013
@@ -16,21 +16,18 @@
  */
package org.apache.commons.imaging.formats.pnm;

-public final class PnmConstants {
-    public static final byte PNM_PREFIX_BYTE = 0x50; // P
+interface PnmConstants {
+    byte PNM_PREFIX_BYTE = 0x50; // P

-    public static final byte PBM_TEXT_CODE = 0x31; // Textual Bitmap
-    public static final byte PGM_TEXT_CODE = 0x32; // Textual GrayMap
-    public static final byte PPM_TEXT_CODE = 0x33; // Textual Pixmap
-    public static final byte PGM_RAW_CODE = 0x35; // RAW GrayMap
-    public static final byte PBM_RAW_CODE = 0x34; // RAW Bitmap
-    public static final byte PPM_RAW_CODE = 0x36; // RAW Pixmap
-    public static final byte PAM_RAW_CODE = 0x37; // PAM Pixmap
+    byte PBM_TEXT_CODE = 0x31; // Textual Bitmap
+    byte PGM_TEXT_CODE = 0x32; // Textual GrayMap
+    byte PPM_TEXT_CODE = 0x33; // Textual Pixmap
+    byte PGM_RAW_CODE = 0x35; // RAW GrayMap
+    byte PBM_RAW_CODE = 0x34; // RAW Bitmap
+    byte PPM_RAW_CODE = 0x36; // RAW Pixmap
+    byte PAM_RAW_CODE = 0x37; // PAM Pixmap

-    public static final byte PNM_SEPARATOR = 0x20; // Space
-    public static final byte PNM_NEWLINE = 0x0A; // "usually a newline"
-                                                 // 
(http://netpbm.sourceforge.net/doc/pbm.html)
-    
-    private PnmConstants() {
-    }
+    byte PNM_SEPARATOR = 0x20; // Space
+    byte PNM_NEWLINE = 0x0A; // "usually a newline"
+                             // (http://netpbm.sourceforge.net/doc/pbm.html)
}


Reply via email to