class EurekaServiceInstance implements ServiceInstance {

	private final InstanceInfo instance;

	public EurekaServiceInstance(InstanceInfo instance) {
		Assert.notNull(instance, "Service instance required");
		this.instance = instance;
	}

	public InstanceInfo getInstanceInfo() {
		return instance;
	}

	@Override
	public String getInstanceId() {
		return this.instance.getId();
	}

	@Override
	public String getServiceId() {
		return this.instance.getAppName();
	}

	@Override
	public String getHost() {
		return this.instance.getHostName();
	}

	@Override
	public int getPort() {
		if (isSecure()) {
			return this.instance.getSecurePort();
		}
		return this.instance.getPort();
	}

	@Override
	public boolean isSecure() {
		// assume if secure is enabled, that is the default
		return this.instance.isPortEnabled(SECURE);
	}

	@Override
	public URI getUri() {
		return DefaultServiceInstance.getUri(this);
	}

	@Override
	public Map<String, String> getMetadata() {
		return this.instance.getMetadata();
	}

	@Override
	public String getScheme() {
		return getUri().getScheme();
	}

	@Override
	public boolean equals(Object o) {<FILL_FUNCTION_BODY>}

	@Override
	public int hashCode() {
		return Objects.hash(this.instance);
	}

	@Override
	public String toString() {
		return new ToStringCreator(this).append("instance", instance).toString();

	}

}

		if (this == o) {
			return true;
		}
		if (o == null || getClass() != o.getClass()) {
			return false;
		}
		EurekaServiceInstance that = (EurekaServiceInstance) o;
		return Objects.equals(this.instance, that.instance);
	
<no_super_class>