-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/3.1.x'
- Loading branch information
Showing
5 changed files
with
114 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
...erver/src/main/java/org/springframework/cloud/netflix/eureka/server/EurekaProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* Copyright 2013-2022 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.springframework.cloud.netflix.eureka.server; | ||
|
||
import java.util.Objects; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
||
/** | ||
* Configuration properties for the Eureka deployment. | ||
* | ||
* @author Weix Sun | ||
*/ | ||
@ConfigurationProperties("eureka") | ||
public class EurekaProperties { | ||
|
||
/** | ||
* Eureka environment. Defaults to "test". | ||
*/ | ||
private String environment = "test"; | ||
|
||
/** | ||
* Eureka datacenter. Defaults to "default". | ||
*/ | ||
private String datacenter = "default"; | ||
|
||
public String getEnvironment() { | ||
return environment; | ||
} | ||
|
||
public void setEnvironment(String environment) { | ||
this.environment = environment; | ||
} | ||
|
||
public String getDatacenter() { | ||
return datacenter; | ||
} | ||
|
||
public void setDatacenter(String datacenter) { | ||
this.datacenter = datacenter; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
EurekaProperties that = (EurekaProperties) o; | ||
return Objects.equals(datacenter, that.datacenter) && Objects.equals(environment, that.environment); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(environment, datacenter); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
final StringBuilder sb = new StringBuilder("EurekaProperties{"); | ||
sb.append("environment='").append(environment).append('\''); | ||
sb.append(", datacenter=").append(datacenter); | ||
sb.append('}'); | ||
return sb.toString(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters