class Type1Encoding extends Encoding
{
    /**
     * Creates an encoding from the given FontBox encoding.
     *
     * @param encoding FontBox encoding
     * @return the encoding created from the given FontBox encoding
     */
    public static Type1Encoding fromFontBox(org.apache.fontbox.encoding.Encoding encoding)
    {<FILL_FUNCTION_BODY>}

    /**
     * Creates an empty encoding.
     */
    public Type1Encoding()
    {
    }

    /**
     * Creates an encoding from the given AFM font metrics.
     *
     * @param fontMetrics AFM font metrics.
     */
    public Type1Encoding(FontMetrics fontMetrics)
    {
        for (CharMetric nextMetric : fontMetrics.getCharMetrics())
        {
            add(nextMetric.getCharacterCode(), nextMetric.getName());
        }
    }

    @Override
    public COSBase getCOSObject()
    {
        return null;
    }

    @Override
    public String getEncodingName()
    {
        return "built-in (Type 1)";
    }
}

        // todo: could optimise this by looking for specific subclasses
        Map<Integer,String> codeToName = encoding.getCodeToNameMap();
        Type1Encoding enc = new Type1Encoding();
        codeToName.forEach(enc::add);
        return enc;
    
<methods>public non-sealed void <init>() ,public boolean contains(java.lang.String) ,public boolean contains(int) ,public Map<java.lang.Integer,java.lang.String> getCodeToNameMap() ,public abstract java.lang.String getEncodingName() ,public static org.apache.pdfbox.pdmodel.font.encoding.Encoding getInstance(org.apache.pdfbox.cos.COSName) ,public java.lang.String getName(int) ,public Map<java.lang.String,java.lang.Integer> getNameToCodeMap() <variables>protected static final int CHAR_CODE,protected static final int CHAR_NAME,protected final Map<java.lang.Integer,java.lang.String> codeToName,protected final Map<java.lang.String,java.lang.Integer> inverted