Public:BWmeta service/Java mapping

From YaddaWiki

< Public:BWmeta service
Revision as of 10:36, 27 September 2010 by Bolo (Talk | contribs)
Jump to: navigation, search
Service details
NameBWmeta
Code location
(relative to SVN root)
projects/dir/bwmeta-core
Javadoc
Contact personJakub Jurkiewicz

General contracts

Unless explicitly stated in the documentation, every "Y" class has the following properties:

  • has a public empty constructor.
  • every property is protected, but has a public getter and setter.
  • getters of String, YLanguage and List properties can never return null. Instead, an empty String, YLanguage.Undetermined or an empty List is returned, respectively.
  • for every List<T> property:
    • its getter returns a modifiable List<T>;
    • its getter returns the same reference all the time;
    • its setter accepts any Collection<T> (and copies the contents);
    • there's an adder (which returns this).
  • every setter and every list adder returns this, which allows chained setting, e.g.:
new YElement()
    .setId("bwmeta1.element.foo")
    .addName(new YName().setText("Foo").setLanguage(YLanguage.English))
    .addDescription(new YDescription().setText("Lorem ipsum").setLanguage(YLanguage.Latin));

The folowing contracts are to be implemented/verified in the future:

  • hashCode() and equals() methods are based on the values of all the properties, i.e., two "Y" objects are equal iff they are of the same type and all their properties are equal.


Personal tools