{"id":694,"date":"2011-07-02T22:14:46","date_gmt":"2011-07-02T20:14:46","guid":{"rendered":"https:\/\/bob-team.de\/wordpress\/?p=694"},"modified":"2011-07-02T22:15:39","modified_gmt":"2011-07-02T20:15:39","slug":"apache-commons","status":"publish","type":"post","link":"https:\/\/bob-team.de\/wordpress\/2011\/07\/02\/apache-commons\/","title":{"rendered":"Apache-Commons"},"content":{"rendered":"<p>Die <a href=\"http:\/\/semanticeyes.blogspot.com\/2011\/06\/common-uses-of-apache-commons-1.html\">Artikelserie &#8222;Common uses of Apache Commons&#8220;<\/a> zeigt Beispiele f\u00fcr den Einsatz von <a href=\"http:\/\/de.wikipedia.org\/wiki\/Apache_Commons\">Apache Commons<\/a>. Eine Sammlung von Klassen, die oft ben\u00f6tigte Aufgaben \u00fcbernehmen k\u00f6nnen. <!--more--><\/p>\n<p><a href=\"http:\/\/commons.apache.org\/lang\/api-2.6\/org\/apache\/commons\/lang\/StringUtils.html\">StringUtils<\/a><\/p>\n<ul>\n<li>IsEmpty\/IsBlank &#8211; checks if a String contains text<\/li>\n<li>Trim\/Strip &#8211; removes leading and trailing whitespace<\/li>\n<li>Split\/Join &#8211; splits a String into an array of substrings and vice versa<\/li>\n<li>IsAlpha\/IsNumeric\/IsWhitespace\/IsAsciiPrintable &#8211; checks the characters in a String<\/li>\n<\/ul>\n<p><a href=\"http:\/\/commons.apache.org\/beanutils\/api\/org\/apache\/commons\/beanutils\/BeanUtils.html\">BeanUtils<\/a><\/p>\n<ul>\n<li>copyProperties(Object dest, Object orig) Copy property values from the origin bean to the destination bean for all cases where the property names are the same.<\/li>\n<li>describe(Object bean) Return the entire set of properties for which the specified bean provides a read method.<\/li>\n<li>populate(Object bean, Map properties) Populate the JavaBeans properties of the specified bean, based on the specified name\/value pairs.<\/li>\n<\/ul>\n<p><a href=\"http:\/\/commons.apache.org\/collections\/apidocs\/org\/apache\/commons\/collections\/CollectionUtils.html\">CollectionUtils<\/a><\/p>\n<ul>\n<li>intersection(java.util.Collection a, java.util.Collection b) Returns a Collection containing the intersection of the given Collections.<\/li>\n<li>isEmpty(java.util.Collection coll) Null-safe check if the specified collection is empty.<\/li>\n<li>subtract(java.util.Collection a, java.util.Collection b) Returns a new Collection containing a-b.<\/li>\n<\/ul>\n<p><a href=\"http:\/\/commons.apache.org\/lang\/api-2.4\/org\/apache\/commons\/lang\/builder\/ReflectionToStringBuilder.html\">ReflectionToStringBuilder<\/a><\/p>\n<p>[code lang=&#8220;java&#8220;]public String toString() {<br \/>\n   return ReflectionToStringBuilder.toString(this);<br \/>\n}[\/code]<\/p>\n<p>ToStringBuilder<\/p>\n<p>[code lang=&#8220;java&#8220;]public String toString() {<br \/>\n   return new ToStringBuilder(this).<br \/>\n   append(&#8222;Name&#8220;, name).<br \/>\n   append(&#8222;Age&#8220;, age).toString();<br \/>\n}[\/code]<\/p>\n<p><a href=\"http:\/\/commons.apache.org\/lang\/api-2.4\/org\/apache\/commons\/lang\/builder\/EqualsBuilder.html\">EqualsBuilder<\/a><\/p>\n<p>[code lang=&#8220;java&#8220;]public boolean equals(Object that) {<br \/>\n   return EqualsBuilder.reflectionEquals(this, that);<br \/>\n}[\/code]<\/p>\n<p>[code lang=&#8220;java&#8220;]public boolean equals(Object that) {<br \/>\n   EqualsBuilder builder = new EqualsBuilder();<br \/>\n   return builder.append(this.field1, that.field1)<br \/>\n         .append(this.field2, that.field2)<br \/>\n         .isEquals();<br \/>\n}[\/code]<\/p>\n<p><a href=\"http:\/\/commons.apache.org\/lang\/api-2.4\/org\/apache\/commons\/lang\/builder\/CompareToBuilder.html\">CompareToBuilder<\/a><\/p>\n<p>[code lang=&#8220;java&#8220;]public int compareTo(Object rhs) {<br \/>\n   return CompareToBuilder.reflectionCompare(this, rhs);<br \/>\n}[\/code]<\/p>\n<p>[code lang=&#8220;java&#8220;]public int compare(Object this, Object rhs) {<br \/>\n   CompareToBuilder builder = new CompareToBuilder();<br \/>\n   return builder.append(this.name, rhs.name).toComparison();<br \/>\n}[\/code]<\/p>\n<p><a href=\"http:\/\/commons.apache.org\/lang\/api-2.4\/org\/apache\/commons\/lang\/builder\/HashCodeBuilder.html\">HashCodeBuilder<\/a><\/p>\n<p>[code lang=&#8220;java&#8220;]public int hashCode() {<br \/>\n   return HashCodeBuilder.reflectionHashCode(this);<br \/>\n}[\/code]<\/p>\n<p>[code lang=&#8220;java&#8220;]public int hashCode() {<br \/>\n   HashCodeBuilder builder = new HashCodeBuilder();<br \/>\n   return builder.append(this.value1)<br \/>\n         .append(this.value2)<br \/>\n         .toHashCode();<br \/>\n}[\/code]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Die Artikelserie &#8222;Common uses of Apache Commons&#8220; zeigt Beispiele f\u00fcr den Einsatz von Apache Commons. Eine Sammlung von Klassen, die oft ben\u00f6tigte Aufgaben \u00fcbernehmen k\u00f6nnen.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[63],"class_list":["post-694","post","type-post","status-publish","format-standard","hentry","category-java","tag-apache-commons","entry"],"_links":{"self":[{"href":"https:\/\/bob-team.de\/wordpress\/wp-json\/wp\/v2\/posts\/694","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bob-team.de\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bob-team.de\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bob-team.de\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bob-team.de\/wordpress\/wp-json\/wp\/v2\/comments?post=694"}],"version-history":[{"count":5,"href":"https:\/\/bob-team.de\/wordpress\/wp-json\/wp\/v2\/posts\/694\/revisions"}],"predecessor-version":[{"id":699,"href":"https:\/\/bob-team.de\/wordpress\/wp-json\/wp\/v2\/posts\/694\/revisions\/699"}],"wp:attachment":[{"href":"https:\/\/bob-team.de\/wordpress\/wp-json\/wp\/v2\/media?parent=694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bob-team.de\/wordpress\/wp-json\/wp\/v2\/categories?post=694"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bob-team.de\/wordpress\/wp-json\/wp\/v2\/tags?post=694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}