@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCollectionId() == null) ? 0 : getCollectionId().hashCode()); hashCode = prime * hashCode + ((getFaceMatchThreshold() == null) ? 0 : getFaceMatchThreshold().hashCode()); return hashCode; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getFaceSearch() == null) ? 0 : getFaceSearch().hashCode()); return hashCode; }
/** * <p> * The ID of a collection that contains faces that you want to search for. * </p> * * @param collectionId * The ID of a collection that contains faces that you want to search for. * @return Returns a reference to this object so that method calls can be chained together. */ public FaceSearchSettings withCollectionId(String collectionId) { setCollectionId(collectionId); return this; }
public FaceSearchSettings unmarshall(JsonUnmarshallerContext context) throws Exception { FaceSearchSettings faceSearchSettings = new FaceSearchSettings(); if (context.testExpression("CollectionId", targetDepth)) { context.nextToken(); faceSearchSettings.setCollectionId(context.getUnmarshaller(String.class).unmarshall(context)); faceSearchSettings.setFaceMatchThreshold(context.getUnmarshaller(Float.class).unmarshall(context));
public CreateStreamProcessorResult createStreamProcessor() { final KinesisVideoStream kinesisVideoStream = new KinesisVideoStream().withArn(kinesisVideoStreamArn); final StreamProcessorInput streamProcessorInput = new StreamProcessorInput().withKinesisVideoStream(kinesisVideoStream); final KinesisDataStream kinesisDataStream = new KinesisDataStream().withArn(kinesisDataStreamArn); final StreamProcessorOutput streamProcessorOutput = new StreamProcessorOutput().withKinesisDataStream(kinesisDataStream); final FaceSearchSettings faceSearchSettings = new FaceSearchSettings().withCollectionId(collectionId).withFaceMatchThreshold(matchThreshold); final StreamProcessorSettings streamProcessorSettings = new StreamProcessorSettings().withFaceSearch(faceSearchSettings); final CreateStreamProcessorResult createStreamProcessorResult = rekognitionClient.createStreamProcessor(new CreateStreamProcessorRequest().withInput(streamProcessorInput).withOutput(streamProcessorOutput).withSettings(streamProcessorSettings).withRoleArn(roleArn).withName(streamProcessorName)); log.info("StreamProcessorArn : {} ", createStreamProcessorResult.getStreamProcessorArn()); return createStreamProcessorResult; }
public DescribeStreamProcessorResult describeStreamProcessor() { final DescribeStreamProcessorResult describeStreamProcessorResult = rekognitionClient.describeStreamProcessor(new DescribeStreamProcessorRequest().withName(streamProcessorName)); log.info("Arn : {}", describeStreamProcessorResult.getStreamProcessorArn()); log.info("Input kinesisVideo stream : {} ", describeStreamProcessorResult.getInput().getKinesisVideoStream().getArn()); log.info("Output kinesisData stream {} ", describeStreamProcessorResult.getOutput().getKinesisDataStream().getArn()); log.info("RoleArn {} ", describeStreamProcessorResult.getRoleArn()); log.info("CollectionId {} ", describeStreamProcessorResult.getSettings().getFaceSearch().getCollectionId()); log.info("Status {} ", describeStreamProcessorResult.getStatus()); log.info("Status message {} ", describeStreamProcessorResult.getStatusMessage()); log.info("Creation timestamp {} ", describeStreamProcessorResult.getCreationTimestamp()); log.info("Last update timestamp {} ", describeStreamProcessorResult.getLastUpdateTimestamp()); return describeStreamProcessorResult; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof StreamProcessorSettings == false) return false; StreamProcessorSettings other = (StreamProcessorSettings) obj; if (other.getFaceSearch() == null ^ this.getFaceSearch() == null) return false; if (other.getFaceSearch() != null && other.getFaceSearch().equals(this.getFaceSearch()) == false) return false; return true; }
/** * <p> * Minimum face match confidence score that must be met to return a result for a recognized face. Default is 70. 0 * is the lowest confidence. 100 is the highest confidence. * </p> * * @param faceMatchThreshold * Minimum face match confidence score that must be met to return a result for a recognized face. Default is * 70. 0 is the lowest confidence. 100 is the highest confidence. * @return Returns a reference to this object so that method calls can be chained together. */ public FaceSearchSettings withFaceMatchThreshold(Float faceMatchThreshold) { setFaceMatchThreshold(faceMatchThreshold); return this; }
public FaceSearchSettings unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } FaceSearchSettings faceSearchSettings = new FaceSearchSettings(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("CollectionId")) { faceSearchSettings.setCollectionId(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("FaceMatchThreshold")) { faceSearchSettings.setFaceMatchThreshold(FloatJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return faceSearchSettings; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof StreamProcessorSettings == false) return false; StreamProcessorSettings other = (StreamProcessorSettings) obj; if (other.getFaceSearch() == null ^ this.getFaceSearch() == null) return false; if (other.getFaceSearch() != null && other.getFaceSearch().equals(this.getFaceSearch()) == false) return false; return true; } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof FaceSearchSettings == false) return false; FaceSearchSettings other = (FaceSearchSettings) obj; if (other.getCollectionId() == null ^ this.getCollectionId() == null) return false; if (other.getCollectionId() != null && other.getCollectionId().equals(this.getCollectionId()) == false) return false; if (other.getFaceMatchThreshold() == null ^ this.getFaceMatchThreshold() == null) return false; if (other.getFaceMatchThreshold() != null && other.getFaceMatchThreshold().equals(this.getFaceMatchThreshold()) == false) return false; return true; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getFaceSearch() == null) ? 0 : getFaceSearch().hashCode()); return hashCode; }
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getCollectionId() != null) sb.append("CollectionId: ").append(getCollectionId()).append(","); if (getFaceMatchThreshold() != null) sb.append("FaceMatchThreshold: ").append(getFaceMatchThreshold()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(FaceSearchSettings faceSearchSettings, ProtocolMarshaller protocolMarshaller) { if (faceSearchSettings == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(faceSearchSettings.getCollectionId(), COLLECTIONID_BINDING); protocolMarshaller.marshall(faceSearchSettings.getFaceMatchThreshold(), FACEMATCHTHRESHOLD_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getCollectionId() == null) ? 0 : getCollectionId().hashCode()); hashCode = prime * hashCode + ((getFaceMatchThreshold() == null) ? 0 : getFaceMatchThreshold().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof FaceSearchSettings == false) return false; FaceSearchSettings other = (FaceSearchSettings) obj; if (other.getCollectionId() == null ^ this.getCollectionId() == null) return false; if (other.getCollectionId() != null && other.getCollectionId().equals(this.getCollectionId()) == false) return false; if (other.getFaceMatchThreshold() == null ^ this.getFaceMatchThreshold() == null) return false; if (other.getFaceMatchThreshold() != null && other.getFaceMatchThreshold().equals(this.getFaceMatchThreshold()) == false) return false; return true; } }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getCollectionId() != null) sb.append("CollectionId: " + getCollectionId() + ","); if (getFaceMatchThreshold() != null) sb.append("FaceMatchThreshold: " + getFaceMatchThreshold()); sb.append("}"); return sb.toString(); }
public void marshall(FaceSearchSettings faceSearchSettings, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.beginObject(); if (faceSearchSettings.getCollectionId() != null) { String collectionId = faceSearchSettings.getCollectionId(); jsonWriter.name("CollectionId"); jsonWriter.value(collectionId); } if (faceSearchSettings.getFaceMatchThreshold() != null) { Float faceMatchThreshold = faceSearchSettings.getFaceMatchThreshold(); jsonWriter.name("FaceMatchThreshold"); jsonWriter.value(faceMatchThreshold); } jsonWriter.endObject(); }