List of usage examples for java.util Objects equals
public static boolean equals(Object a, Object b)
From source file:com.autodesk.client.model.Metadata.java
@Override public boolean equals(java.lang.Object o) { if (this == o) { return true; }//from w ww. j a v a 2 s . c o m if (o == null || getClass() != o.getClass()) { return false; } Metadata metadata = (Metadata) o; return Objects.equals(this.data, metadata.data); }
From source file:com.cloud.agent.api.element.ExtraDhcpOptionsVspCommand.java
@Override public boolean equals(Object o) { if (this == o) { return true; }/*from w w w . jav a 2 s .co m*/ if (!(o instanceof ExtraDhcpOptionsVspCommand)) { return false; } ExtraDhcpOptionsVspCommand that = (ExtraDhcpOptionsVspCommand) o; return super.equals(that) && Objects.equals(network, that.network) && Objects.equals(nicUuid, that.nicUuid) && Objects.equals(dhcpOptions, that.dhcpOptions); }
From source file:fr.bird.bloom.model.DatabaseTreatment.java
/** * Do a connection to the database//from w ww. j av a 2 s.c o m * @param String choiceStatement : execute, executeQuery or executeUpdate * @param String sql : request * @return ArrayList<String> */ public List<String> executeSQLcommand(String choiceStatement, String sql) { //this.getRessourcesMysql(); List<String> messages = new ArrayList<>(); try { messages.add("\nChargement du driver..."); Class.forName("com.mysql.jdbc.Driver"); messages.add("Driver charg !"); } catch (ClassNotFoundException e) { messages.add("Erreur lors du chargement : le driver n'a pas t trouv dans le classpath ! <br/>" + e.getMessage()); } try { messages.add("Connexion la base de donnes ..."); //connexion = DriverManager.getConnection( url, user, password ); messages.add("Connexion russie !"); /* Create managing object of request */ //statement = connexion.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); messages.add("Objet requte cr !"); //global method for any SQL script - return a boolean : true if the instruction return ResultSet, false else if (Objects.equals(choiceStatement, "execute")) { this.setResultat(statement.execute(sql)); messages.add(sql); //messages.add(resultat.toString()); } // SELECT - return ResultSet, with results : TDWG= else if (Objects.equals(choiceStatement, "executeQuery")) { this.resultSet = statement.executeQuery(sql); messages.add(sql); ResultSetMetaData resultMeta = this.resultSet.getMetaData(); setResultatSelect(resultMeta); this.resultSet.close(); } /* writing or deleting on DB (for INSERT, UPDATE, DELETE, ...) * give lines number edited by INSERT, UPDATE et DELETE * or 0 for no return methods like CREATE */ else if (Objects.equals(choiceStatement, "executeUpdate")) { i = statement.executeUpdate(sql); messages.add(sql); //messages.add("nb lignes affectes => " + Integer.toString(i)); } statement.close(); } catch (SQLException e) { messages.add("Connection error : " + e.getMessage()); do { System.out.println("SQLState : " + e.getSQLState()); System.out.println("Description : " + e.getMessage()); System.out.println("Error code : " + e.getErrorCode()); System.out.println(sql); System.out.println(); e = e.getNextException(); } while (e != null); } return messages; }
From source file:com.vsct.dt.hesperides.feedback.jsonObject.FeedbackObject.java
@Override public boolean equals(Object obj) { if (this == obj) { return true; }// w ww .j av a 2s .c o m if (obj == null || getClass() != obj.getClass()) { return false; } final FeedbackObject other = (FeedbackObject) obj; return Objects.equals(this.url, other.url) && Objects.equals(this.timestamp, other.timestamp) && Objects.equals(this.img, other.img) && Objects.equals(this.note, other.note); }
From source file:com.jivesoftware.os.upena.shared.Cluster.java
@Override public boolean equals(Object obj) { if (obj == null) { return false; }/*from www .j ava 2 s.com*/ if (getClass() != obj.getClass()) { return false; } final Cluster other = (Cluster) obj; if (!Objects.equals(this.name, other.name)) { return false; } return true; }
From source file:com.autodesk.client.model.AnalyzeMeshParams.java
@Override public boolean equals(java.lang.Object o) { if (this == o) { return true; }//from www .ja v a 2 s . c o m if (o == null || getClass() != o.getClass()) { return false; } AnalyzeMeshParams analyzeMeshParams = (AnalyzeMeshParams) o; return Objects.equals(this.id, analyzeMeshParams.id); }
From source file:com.vsct.dt.hesperides.util.HesperidesVersion.java
@Override public boolean equals(Object obj) { if (this == obj) { return true; }/*from www .j a v a 2s . c o m*/ if (obj == null || getClass() != obj.getClass()) { return false; } final HesperidesVersion other = (HesperidesVersion) obj; return Objects.equals(this.versionName, other.versionName) && Objects.equals(this.isWorkingCopy, other.isWorkingCopy); }
From source file:com.autodesk.client.model.ActivityVersion.java
@Override public boolean equals(java.lang.Object o) { if (this == o) { return true; }/* www . ja v a2 s.c o m*/ if (o == null || getClass() != o.getClass()) { return false; } ActivityVersion activityVersion = (ActivityVersion) o; return Objects.equals(this.version, activityVersion.version); }
From source file:com.autodesk.client.model.AppPackageVersion.java
@Override public boolean equals(java.lang.Object o) { if (this == o) { return true; }/*from w w w.jav a 2s. c o m*/ if (o == null || getClass() != o.getClass()) { return false; } AppPackageVersion appPackageVersion = (AppPackageVersion) o; return Objects.equals(this.version, appPackageVersion.version); }
From source file:io.github.thred.climatetray.sim.ClimateTrayServerSimController.java
protected ClimateTrayServerSimState getStateByAddress(String address) { return states.stream().filter(state -> Objects.equals(address, state.getAddress())).findFirst() .orElse(null);/*from w w w . j a v a2 s . c o m*/ }