Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

cufyorg-archive/cufy-beans

Repository files navigation

Beans

A bean is a map that it's fields is the properties of it.

  • Compatible anywhere. Since it is a map.
  • Any object can be a bean. Just with annotations.
  • Interface based. Any class can implement.
  • fields tris to convert the value before storing it.

Dependencies


A bean example:

    class ExBean extends Bean {
        @Property
        int ex_property;
    }

A bean for a non-bean instance (fields should be annotated):

    Bean.forInstance(theInstance);

You can override the key (default is a string of field's name) and the type of the property.

    @Property(key = @MetaObject("newKey"), type = @MetaClazz(Integer.class))
    int ex_property;