@Override public boolean equals( Object o ) { if ( !super.equals( o ) ) { return false; } if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } final InteractorImpl that = ( InteractorImpl ) o; if ( activeInstances != null ? !activeInstances.equals( that.activeInstances ) : that.activeInstances != null ) { return false; } if ( bioSource != null ? !bioSource.equals( that.bioSource ) : that.bioSource != null ) { return false; } if ( interactorType != null ? !interactorType.equals( that.interactorType ) : that.interactorType != null ) { return false; } return true; }
protected boolean equals( Object o, boolean checkOnActiveInstances) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } if ( !super.equals( o ) ) { return false; } final InteractorImpl that = ( InteractorImpl ) o; if (checkOnActiveInstances) { if ( activeInstances != null ? !CollectionUtils.isEqualCollection(activeInstances, that.activeInstances ) : that.activeInstances != null ) { return false; } } if ( bioSource != null ? !bioSource.equals( that.bioSource ) : that.bioSource != null ) { return false; } if ( interactorType != null ? !interactorType.equals( that.interactorType ) : that.interactorType != null ) { return false; } return true; }
protected boolean equals( Object o, boolean checkOnActiveInstances) { if ( this == o ) { return true; } if ( o == null || getClass() != o.getClass() ) { return false; } if ( !super.equals( o ) ) { return false; } final InteractorImpl that = ( InteractorImpl ) o; if (checkOnActiveInstances) { if ( activeInstances != null ? !CollectionUtils.isEqualCollection(activeInstances, that.activeInstances ) : that.activeInstances != null ) { return false; } } if ( bioSource != null ? !bioSource.equals( that.bioSource ) : that.bioSource != null ) { return false; } if ( interactorType != null ? !interactorType.equals( that.interactorType ) : that.interactorType != null ) { return false; } return true; }
/** * Answers the question: "Has the given interaction got only interactors of the given type ?". * <p/> * note: an interaction without interactor is not valid. * * @param interaction the interaction. * @param type the interactor type. * @return true if all interactor are of the given type, false otherwise. */ public static boolean hasOnlyInteractorOfType(Interaction interaction, CvInteractorType type) { if (type == null) { throw new IllegalArgumentException("You must give a non null CvInteractorType."); } if (interaction == null) { throw new IllegalArgumentException("You must give a non null Interaction."); } if (interaction.getComponents().isEmpty()) { return false; } for (Component component : interaction.getComponents()) { Interactor interactor = component.getInteractor(); if (!type.equals(interactor.getCvInteractorType())) { return false; } } return true; }
/** * Answers the question: "Has the given interaction got only interactors of the given type ?". * <p/> * note: an interaction without interactor is not valid. * * @param interaction the interaction. * @param type the interactor type. * @return true if all interactor are of the given type, false otherwise. */ public static boolean hasOnlyInteractorOfType(Interaction interaction, CvInteractorType type) { if (type == null) { throw new IllegalArgumentException("You must give a non null CvInteractorType."); } if (interaction == null) { throw new IllegalArgumentException("You must give a non null Interaction."); } if (interaction.getComponents().isEmpty()) { return false; } for (Component component : interaction.getComponents()) { Interactor interactor = component.getInteractor(); if (!type.equals(interactor.getCvInteractorType())) { return false; } } return true; }
/** * Answers the question: "Has the given interaction got only interactors of the given type ?". * <p/> * note: an interaction without interactor is not valid. * * @param interaction the interaction. * @param type the interactor type. * @return true if all interactor are of the given type, false otherwise. */ public static boolean hasOnlyInteractorOfType( Interaction interaction, CvInteractorType type ) { if ( type == null ) { throw new IllegalArgumentException( "You must give a non null CvInteractorType." ); } if ( interaction == null ) { throw new IllegalArgumentException( "You must give a non null Interaction." ); } if ( interaction.getComponents().isEmpty() ) { return false; } for ( Component component : interaction.getComponents() ) { Interactor interactor = component.getInteractor(); if ( !type.equals( interactor.getCvInteractorType() ) ) { return false; } } return true; }