search/engine/api/src/main/java/net/sf/mmm/search/view/base/SearchEntryTypeViewBean.java
/**
   * This method combines the given <code>type</code> with this object. Therefore the
   * {@link SearchEntryType#getTitle() title} of all {@link #combine(SearchEntryType, long) combined} types
   * has to be equal.
   * 
   * @param type is the {@link SearchEntryType} to combine.
   * @param typeCount is the {@link net.sf.mmm.search.engine.api.SearchEngine#count(String, String) count} for
   *        the given <code>type</code>.
   */
This method combines the given type with this object. Therefore the
SearchEntryType#getTitle() title of all  #combine(SearchEntryType, long) combined types
has to be equal.

@param type is the  SearchEntryType to combine.
@param typeCount is the  net.sf.mmm.search.engine.api.SearchEngine#count(String, String) count for
the given type.
This method combines the given type with this object . Therefore the SearchEntryType#getTitle () title of all #combine ( SearchEntryType long ) combined types has to be equal . @param type is the SearchEntryType to combine . @param typeCount is the net . sf . mmm . search . engine . api . SearchEngine#count ( String String ) count for the given type .
public void combine(SearchEntryType type, long typeCount) {
    NlsNullPointerException.checkNotNull(SearchEntryType.class, type);
    if (type instanceof SearchEntryTypeView) {
      throw new NlsIllegalStateException();
    }
    String typeTitle = type.getTitle();
    String title = getTitle();
    if (title == null) {
      setTitle(typeTitle);
    } else if (!title.equals(typeTitle)) {
      throw new NlsIllegalStateException();
    }
    String typeIcon = type.getIcon();
    String id = getId();
    String typeId = type.getId();
    if (typeIcon != null) {
      if (id == null) {
        setId(typeId);
        setIcon(typeIcon);
      } else {
        if (!typeIcon.equals(getIcon())) {
          LOGGER.warn("Mismatching icons for " + SearchEntryType.class.getSimpleName() + " with title '" + title
              + "' (" + typeIcon + " != " + getIcon() + ")");
        }
      }
    }
    this.entryCount = this.entryCount + typeCount;
    if (!ID_ANY.equals(typeId)) {
      this.combinedIds.add(typeId);
    }
  }
public void combine ( SearchEntryType type , long typeCount ) { NlsNullPointerException . checkNotNull ( SearchEntryType . class , type ) ; if ( type instanceof SearchEntryTypeView ) { throw new NlsIllegalStateException ( ) ; } String typeTitle = type . getTitle ( ) ; String title = getTitle ( ) ; if ( title == null ) { setTitle ( typeTitle ) ; } else if ( ! title . equals ( typeTitle ) ) { throw new NlsIllegalStateException ( ) ; } String typeIcon = type . getIcon ( ) ; String id = getId ( ) ; String typeId = type . getId ( ) ; if ( typeIcon != null ) { if ( id == null ) { setId ( typeId ) ; setIcon ( typeIcon ) ; } else { if ( ! typeIcon . equals ( getIcon ( ) ) ) { LOGGER . warn ( "Mismatching icons for " + SearchEntryType . class . getSimpleName ( ) + " with title '" + title + "' (" + typeIcon + " != " + getIcon ( ) + ")" ) ; } } } this . entryCount = this . entryCount + typeCount ; if ( ! ID_ANY . equals ( typeId ) ) { this . combinedIds . add ( typeId ) ; } }
This method combines the given <code>type</code> with this object.
This method combines the given <code > type< / code > with this object .
// internal error in code // throw new NlsIllegalStateException();