/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you 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.apache.felix.inventory;

/**
 * Enumeration for the different printer modes.
 */
public final class PrinterMode
{

    // plain text
    public static PrinterMode TEXT = new PrinterMode("TEXT");

    // valid HTML fragment (no external references)
    public static PrinterMode HTML_FRAGMENT = new PrinterMode("HTML_FRAGMENT");

    // JSON output
    public static PrinterMode JSON = new PrinterMode("JSON");

    private final String mode;

    private PrinterMode(final String mode)
    {
        this.mode = mode;
    }

    public static PrinterMode valueOf(final String m)
    {
        if (TEXT.name().equals(m))
        {
            return TEXT;
        }
        else if (HTML_FRAGMENT.name().equals(m))
        {
            return HTML_FRAGMENT;
        }
        else if (JSON.name().equals(m))
        {
            return JSON;
        }
        return null;
    }

    public String name()
    {
        return this.mode;
    }

    /**
     * @see java.lang.Object#hashCode()
     */
    public int hashCode()
    {
        return mode.hashCode();
    }

    /**
     * @see java.lang.Object#equals(java.lang.Object)
     */
    public boolean equals(Object obj)
    {
        if (this == obj)
        {
            return true;
        }
        if (obj == null)
        {
            return false;
        }
        if (getClass() != obj.getClass())
        {
            return false;
        }
        final PrinterMode other = (PrinterMode) obj;
        return mode.equals(other.mode);
    }
}

@@ -417,17 +417,16 @@
 se at%0A *
- 
 %0A * http
@@ -466,17 +466,16 @@
 E-2.0%0A *
- 
 %0A * Unle
@@ -1756,64 +1756,8 @@
  %7D%0A%0A
-    /**%0A     * @see java.lang.Object#hashCode()%0A     */%0A
     
@@ -1827,78 +1827,8 @@
  %7D%0A%0A
-    /**%0A     * @see java.lang.Object#equals(java.lang.Object)%0A     */%0A
     
@@ -2194,11 +2194,76 @@
 );%0A    %7D
+%0A%0A    public String toString()%0A    %7B%0A        return name();%0A    %7D
 %0A%7D%0A

Add toString method and remove superfluous (IMO) comment references