class Literal
    extends Expression {

    @Override
    public <R, C> R accept(AstVisitor<R, C> visitor, C context) {
        return visitor.visitLiteral(this, context);
    }

    public static Literal fromObject(Object value) {<FILL_FUNCTION_BODY>}
}

        Literal literal = null;
        if (value == null) {
            literal = NullLiteral.INSTANCE;
        } else if (value instanceof Number n) {
            if (value instanceof Float || value instanceof Double) {
                literal = new DoubleLiteral(value.toString());
            } else if (value instanceof Short || value instanceof Integer) {
                literal = new IntegerLiteral(n.intValue());
            } else if (value instanceof Long l) {
                literal = new LongLiteral(l);
            }
        } else if (value instanceof Boolean b) {
            literal = b ? BooleanLiteral.TRUE_LITERAL : BooleanLiteral.FALSE_LITERAL;
        } else if (value instanceof Object[] oArray) {
            List<Expression> expressions = new ArrayList<>();
            for (Object o : oArray) {
                expressions.add(fromObject(o));
            }
            literal = new ArrayLiteral(expressions);
        } else if (value instanceof Map) {
            HashMap<String, Expression> map = new HashMap<>();
            @SuppressWarnings("unchecked") Map<String, Object> valueMap = (Map<String, Object>) value;
            for (Map.Entry<String, Object> entry : valueMap.entrySet()) {
                map.put(entry.getKey(), fromObject(entry.getValue()));
            }
            literal = new ObjectLiteral(map);
        } else {
            literal = new StringLiteral(value.toString());
        }
        return literal;
    
<methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public final java.lang.String toString() <variables>