コード例 #1
0
 public Object copyTo(ObjectLocator locator, Object target, CopyStrategy strategy) {
   final Object draftCopy = ((target == null) ? createNewInstance() : target);
   if (draftCopy instanceof SecureSocketSettings) {
     final SecureSocketSettings copy = ((SecureSocketSettings) draftCopy);
     if (this.mode != null) {
       SecureSocketModeEnum sourceMode;
       sourceMode = this.getMode();
       SecureSocketModeEnum copyMode =
           ((SecureSocketModeEnum)
               strategy.copy(LocatorUtils.property(locator, "mode", sourceMode), sourceMode));
       copy.setMode(copyMode);
     } else {
       copy.mode = null;
     }
     if (this.protocol != null) {
       String sourceProtocol;
       sourceProtocol = this.getProtocol();
       String copyProtocol =
           ((String)
               strategy.copy(
                   LocatorUtils.property(locator, "protocol", sourceProtocol), sourceProtocol));
       copy.setProtocol(copyProtocol);
     } else {
       copy.protocol = null;
     }
     if (this.certificateAuthorityFile != null) {
       String sourceCertificateAuthorityFile;
       sourceCertificateAuthorityFile = this.getCertificateAuthorityFile();
       String copyCertificateAuthorityFile =
           ((String)
               strategy.copy(
                   LocatorUtils.property(
                       locator, "certificateAuthorityFile", sourceCertificateAuthorityFile),
                   sourceCertificateAuthorityFile));
       copy.setCertificateAuthorityFile(copyCertificateAuthorityFile);
     } else {
       copy.certificateAuthorityFile = null;
     }
     if (this.clientCertificateFile != null) {
       String sourceClientCertificateFile;
       sourceClientCertificateFile = this.getClientCertificateFile();
       String copyClientCertificateFile =
           ((String)
               strategy.copy(
                   LocatorUtils.property(
                       locator, "clientCertificateFile", sourceClientCertificateFile),
                   sourceClientCertificateFile));
       copy.setClientCertificateFile(copyClientCertificateFile);
     } else {
       copy.clientCertificateFile = null;
     }
     if (this.clientKeyFile != null) {
       String sourceClientKeyFile;
       sourceClientKeyFile = this.getClientKeyFile();
       String copyClientKeyFile =
           ((String)
               strategy.copy(
                   LocatorUtils.property(locator, "clientKeyFile", sourceClientKeyFile),
                   sourceClientKeyFile));
       copy.setClientKeyFile(copyClientKeyFile);
     } else {
       copy.clientKeyFile = null;
     }
     if (this.clientKeyPassword != null) {
       String sourceClientKeyPassword;
       sourceClientKeyPassword = this.getClientKeyPassword();
       String copyClientKeyPassword =
           ((String)
               strategy.copy(
                   LocatorUtils.property(locator, "clientKeyPassword", sourceClientKeyPassword),
                   sourceClientKeyPassword));
       copy.setClientKeyPassword(copyClientKeyPassword);
     } else {
       copy.clientKeyPassword = null;
     }
     if (this.clientKeyPEM != null) {
       Boolean sourceClientKeyPEM;
       sourceClientKeyPEM = this.isClientKeyPEM();
       Boolean copyClientKeyPEM =
           ((Boolean)
               strategy.copy(
                   LocatorUtils.property(locator, "clientKeyPEM", sourceClientKeyPEM),
                   sourceClientKeyPEM));
       copy.setClientKeyPEM(copyClientKeyPEM);
     } else {
       copy.clientKeyPEM = null;
     }
     if (this.serverKeyStoreFile != null) {
       String sourceServerKeyStoreFile;
       sourceServerKeyStoreFile = this.getServerKeyStoreFile();
       String copyServerKeyStoreFile =
           ((String)
               strategy.copy(
                   LocatorUtils.property(locator, "serverKeyStoreFile", sourceServerKeyStoreFile),
                   sourceServerKeyStoreFile));
       copy.setServerKeyStoreFile(copyServerKeyStoreFile);
     } else {
       copy.serverKeyStoreFile = null;
     }
     if (this.serverKeyStorePassword != null) {
       String sourceServerKeyStorePassword;
       sourceServerKeyStorePassword = this.getServerKeyStorePassword();
       String copyServerKeyStorePassword =
           ((String)
               strategy.copy(
                   LocatorUtils.property(
                       locator, "serverKeyStorePassword", sourceServerKeyStorePassword),
                   sourceServerKeyStorePassword));
       copy.setServerKeyStorePassword(copyServerKeyStorePassword);
     } else {
       copy.serverKeyStorePassword = null;
     }
     if (this.clientKeyStoreFile != null) {
       String sourceClientKeyStoreFile;
       sourceClientKeyStoreFile = this.getClientKeyStoreFile();
       String copyClientKeyStoreFile =
           ((String)
               strategy.copy(
                   LocatorUtils.property(locator, "clientKeyStoreFile", sourceClientKeyStoreFile),
                   sourceClientKeyStoreFile));
       copy.setClientKeyStoreFile(copyClientKeyStoreFile);
     } else {
       copy.clientKeyStoreFile = null;
     }
     if (this.clientKeyStorePassword != null) {
       String sourceClientKeyStorePassword;
       sourceClientKeyStorePassword = this.getClientKeyStorePassword();
       String copyClientKeyStorePassword =
           ((String)
               strategy.copy(
                   LocatorUtils.property(
                       locator, "clientKeyStorePassword", sourceClientKeyStorePassword),
                   sourceClientKeyStorePassword));
       copy.setClientKeyStorePassword(copyClientKeyStorePassword);
     } else {
       copy.clientKeyStorePassword = null;
     }
     if ((this.property != null) && (!this.property.isEmpty())) {
       List<Property> sourceProperty;
       sourceProperty =
           (((this.property != null) && (!this.property.isEmpty())) ? this.getProperty() : null);
       @SuppressWarnings("unchecked")
       List<Property> copyProperty =
           ((List<Property>)
               strategy.copy(
                   LocatorUtils.property(locator, "property", sourceProperty), sourceProperty));
       copy.property = null;
       if (copyProperty != null) {
         List<Property> uniquePropertyl = copy.getProperty();
         uniquePropertyl.addAll(copyProperty);
       }
     } else {
       copy.property = null;
     }
   }
   return draftCopy;
 }
コード例 #2
0
 public boolean equals(
     ObjectLocator thisLocator,
     ObjectLocator thatLocator,
     Object object,
     EqualsStrategy strategy) {
   if (!(object instanceof SecureSocketSettings)) {
     return false;
   }
   if (this == object) {
     return true;
   }
   final SecureSocketSettings that = ((SecureSocketSettings) object);
   {
     SecureSocketModeEnum lhsMode;
     lhsMode = this.getMode();
     SecureSocketModeEnum rhsMode;
     rhsMode = that.getMode();
     if (!strategy.equals(
         LocatorUtils.property(thisLocator, "mode", lhsMode),
         LocatorUtils.property(thatLocator, "mode", rhsMode),
         lhsMode,
         rhsMode)) {
       return false;
     }
   }
   {
     String lhsProtocol;
     lhsProtocol = this.getProtocol();
     String rhsProtocol;
     rhsProtocol = that.getProtocol();
     if (!strategy.equals(
         LocatorUtils.property(thisLocator, "protocol", lhsProtocol),
         LocatorUtils.property(thatLocator, "protocol", rhsProtocol),
         lhsProtocol,
         rhsProtocol)) {
       return false;
     }
   }
   {
     String lhsCertificateAuthorityFile;
     lhsCertificateAuthorityFile = this.getCertificateAuthorityFile();
     String rhsCertificateAuthorityFile;
     rhsCertificateAuthorityFile = that.getCertificateAuthorityFile();
     if (!strategy.equals(
         LocatorUtils.property(
             thisLocator, "certificateAuthorityFile", lhsCertificateAuthorityFile),
         LocatorUtils.property(
             thatLocator, "certificateAuthorityFile", rhsCertificateAuthorityFile),
         lhsCertificateAuthorityFile,
         rhsCertificateAuthorityFile)) {
       return false;
     }
   }
   {
     String lhsClientCertificateFile;
     lhsClientCertificateFile = this.getClientCertificateFile();
     String rhsClientCertificateFile;
     rhsClientCertificateFile = that.getClientCertificateFile();
     if (!strategy.equals(
         LocatorUtils.property(thisLocator, "clientCertificateFile", lhsClientCertificateFile),
         LocatorUtils.property(thatLocator, "clientCertificateFile", rhsClientCertificateFile),
         lhsClientCertificateFile,
         rhsClientCertificateFile)) {
       return false;
     }
   }
   {
     String lhsClientKeyFile;
     lhsClientKeyFile = this.getClientKeyFile();
     String rhsClientKeyFile;
     rhsClientKeyFile = that.getClientKeyFile();
     if (!strategy.equals(
         LocatorUtils.property(thisLocator, "clientKeyFile", lhsClientKeyFile),
         LocatorUtils.property(thatLocator, "clientKeyFile", rhsClientKeyFile),
         lhsClientKeyFile,
         rhsClientKeyFile)) {
       return false;
     }
   }
   {
     String lhsClientKeyPassword;
     lhsClientKeyPassword = this.getClientKeyPassword();
     String rhsClientKeyPassword;
     rhsClientKeyPassword = that.getClientKeyPassword();
     if (!strategy.equals(
         LocatorUtils.property(thisLocator, "clientKeyPassword", lhsClientKeyPassword),
         LocatorUtils.property(thatLocator, "clientKeyPassword", rhsClientKeyPassword),
         lhsClientKeyPassword,
         rhsClientKeyPassword)) {
       return false;
     }
   }
   {
     Boolean lhsClientKeyPEM;
     lhsClientKeyPEM = this.isClientKeyPEM();
     Boolean rhsClientKeyPEM;
     rhsClientKeyPEM = that.isClientKeyPEM();
     if (!strategy.equals(
         LocatorUtils.property(thisLocator, "clientKeyPEM", lhsClientKeyPEM),
         LocatorUtils.property(thatLocator, "clientKeyPEM", rhsClientKeyPEM),
         lhsClientKeyPEM,
         rhsClientKeyPEM)) {
       return false;
     }
   }
   {
     String lhsServerKeyStoreFile;
     lhsServerKeyStoreFile = this.getServerKeyStoreFile();
     String rhsServerKeyStoreFile;
     rhsServerKeyStoreFile = that.getServerKeyStoreFile();
     if (!strategy.equals(
         LocatorUtils.property(thisLocator, "serverKeyStoreFile", lhsServerKeyStoreFile),
         LocatorUtils.property(thatLocator, "serverKeyStoreFile", rhsServerKeyStoreFile),
         lhsServerKeyStoreFile,
         rhsServerKeyStoreFile)) {
       return false;
     }
   }
   {
     String lhsServerKeyStorePassword;
     lhsServerKeyStorePassword = this.getServerKeyStorePassword();
     String rhsServerKeyStorePassword;
     rhsServerKeyStorePassword = that.getServerKeyStorePassword();
     if (!strategy.equals(
         LocatorUtils.property(thisLocator, "serverKeyStorePassword", lhsServerKeyStorePassword),
         LocatorUtils.property(thatLocator, "serverKeyStorePassword", rhsServerKeyStorePassword),
         lhsServerKeyStorePassword,
         rhsServerKeyStorePassword)) {
       return false;
     }
   }
   {
     String lhsClientKeyStoreFile;
     lhsClientKeyStoreFile = this.getClientKeyStoreFile();
     String rhsClientKeyStoreFile;
     rhsClientKeyStoreFile = that.getClientKeyStoreFile();
     if (!strategy.equals(
         LocatorUtils.property(thisLocator, "clientKeyStoreFile", lhsClientKeyStoreFile),
         LocatorUtils.property(thatLocator, "clientKeyStoreFile", rhsClientKeyStoreFile),
         lhsClientKeyStoreFile,
         rhsClientKeyStoreFile)) {
       return false;
     }
   }
   {
     String lhsClientKeyStorePassword;
     lhsClientKeyStorePassword = this.getClientKeyStorePassword();
     String rhsClientKeyStorePassword;
     rhsClientKeyStorePassword = that.getClientKeyStorePassword();
     if (!strategy.equals(
         LocatorUtils.property(thisLocator, "clientKeyStorePassword", lhsClientKeyStorePassword),
         LocatorUtils.property(thatLocator, "clientKeyStorePassword", rhsClientKeyStorePassword),
         lhsClientKeyStorePassword,
         rhsClientKeyStorePassword)) {
       return false;
     }
   }
   {
     List<Property> lhsProperty;
     lhsProperty =
         (((this.property != null) && (!this.property.isEmpty())) ? this.getProperty() : null);
     List<Property> rhsProperty;
     rhsProperty =
         (((that.property != null) && (!that.property.isEmpty())) ? that.getProperty() : null);
     if (!strategy.equals(
         LocatorUtils.property(thisLocator, "property", lhsProperty),
         LocatorUtils.property(thatLocator, "property", rhsProperty),
         lhsProperty,
         rhsProperty)) {
       return false;
     }
   }
   return true;
 }