Class Condition (2.5.1) 
  
      
     
  
  
  
   
  
    
  
  
    
    
    
  Version 2.5.1keyboard_arrow_down  
  
 
    
    
     
    
    
    
    
    
      
  
  
  
    
public   final   class  Condition   extends   GeneratedMessageV3   implements   ConditionOrBuilder  
   
   Metadata that is used to define a condition that triggers an action.
 A valid condition must specify at least one of 'query_terms' or
 'products_filter'. If multiple fields are specified, the condition is met if
 all the fields are satisfied e.g. if a set of query terms and product_filter
 are set, then only items matching the product_filter for requests with a
 query matching the query terms wil get boosted.
 Protobuf type google.cloud.retail.v2.Condition
 
  
  
  
  Static Fields
   
  ACTIVE_TIME_RANGE_FIELD_NUMBER 
  
    
public   static   final   int   ACTIVE_TIME_RANGE_FIELD_NUMBER  
   
  Field Value 
  
  QUERY_TERMS_FIELD_NUMBER 
  
    
public   static   final   int   QUERY_TERMS_FIELD_NUMBER  
   
  Field Value 
  
  Static Methods
   
   
  getDefaultInstance() 
  
    
public   static   Condition   getDefaultInstance ()  
   
  Returns 
  
   
  getDescriptor() 
  
    
public   static   final   Descriptors . Descriptor   getDescriptor ()  
   
  Returns 
  
   
  newBuilder() 
  
    
public   static   Condition . Builder   newBuilder ()  
   
  Returns 
  
   
  newBuilder(Condition prototype) 
  
    
public   static   Condition . Builder   newBuilder ( Condition   prototype )  
   
  Parameter 
  
  Returns 
  
   
  
  
    
public   static   Condition   parseDelimitedFrom ( InputStream   input )  
   
  Parameter 
  
  Returns 
  
  Exceptions 
  
   
  
  
    
public   static   Condition   parseDelimitedFrom ( InputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
   
  Parameters 
  
  Returns 
  
  Exceptions 
  
   
  parseFrom(byte[] data) 
  
    
public   static   Condition   parseFrom ( byte []   data )  
   
  Parameter 
  
    
      
        Name  
        Description  
       
      
        data  
        byte [] 
       
     
  
  Returns 
  
  Exceptions 
  
   
  parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) 
  
    
public   static   Condition   parseFrom ( byte []   data ,   ExtensionRegistryLite   extensionRegistry )  
   
  Parameters 
  
  Returns 
  
  Exceptions 
  
   
  parseFrom(ByteString data) 
  
    
public   static   Condition   parseFrom ( ByteString   data )  
   
  Parameter 
  
  Returns 
  
  Exceptions 
  
   
  parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) 
  
    
public   static   Condition   parseFrom ( ByteString   data ,   ExtensionRegistryLite   extensionRegistry )  
   
  Parameters 
  
  Returns 
  
  Exceptions 
  
   
  
  
    
public   static   Condition   parseFrom ( CodedInputStream   input )  
   
  Parameter 
  
  Returns 
  
  Exceptions 
  
   
  
  
    
public   static   Condition   parseFrom ( CodedInputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
   
  Parameters 
  
  Returns 
  
  Exceptions 
  
   
  
  
    
public   static   Condition   parseFrom ( InputStream   input )  
   
  Parameter 
  
  Returns 
  
  Exceptions 
  
   
  
  
    
public   static   Condition   parseFrom ( InputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
   
  Parameters 
  
  Returns 
  
  Exceptions 
  
   
  parseFrom(ByteBuffer data) 
  
    
public   static   Condition   parseFrom ( ByteBuffer   data )  
   
  Parameter 
  
  Returns 
  
  Exceptions 
  
   
  parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry) 
  
    
public   static   Condition   parseFrom ( ByteBuffer   data ,   ExtensionRegistryLite   extensionRegistry )  
   
  Parameters 
  
  Returns 
  
  Exceptions 
  
   
  parser() 
  
    
public   static   Parser<Condition>   parser ()  
   
  Returns 
  
  Methods
   
   
  equals(Object obj) 
  
    
public   boolean   equals ( Object   obj )  
   
  Parameter 
  
  Returns 
  
  Overrides 
  
   
  getActiveTimeRange(int index) 
  
    
public   Condition . TimeRange   getActiveTimeRange ( int   index )  
   
   Range of time(s) specifying when Condition is active.
 Condition true if any time range matches.
 repeated .google.cloud.retail.v2.Condition.TimeRange active_time_range = 3;
 
  Parameter 
  
    
      
        Name  
        Description  
       
      
        index  
        int  
       
     
  
  Returns 
  
   
  getActiveTimeRangeCount() 
  
    
public   int   getActiveTimeRangeCount ()  
   
   Range of time(s) specifying when Condition is active.
 Condition true if any time range matches.
 repeated .google.cloud.retail.v2.Condition.TimeRange active_time_range = 3;
 
  Returns 
  
   
  getActiveTimeRangeList() 
  
    
public   List<Condition . TimeRange >  getActiveTimeRangeList ()  
   
   Range of time(s) specifying when Condition is active.
 Condition true if any time range matches.
 repeated .google.cloud.retail.v2.Condition.TimeRange active_time_range = 3;
 
  Returns 
  
   
  getActiveTimeRangeOrBuilder(int index) 
  
    
public   Condition . TimeRangeOrBuilder   getActiveTimeRangeOrBuilder ( int   index )  
   
   Range of time(s) specifying when Condition is active.
 Condition true if any time range matches.
 repeated .google.cloud.retail.v2.Condition.TimeRange active_time_range = 3;
 
  Parameter 
  
    
      
        Name  
        Description  
       
      
        index  
        int  
       
     
  
  Returns 
  
   
  getActiveTimeRangeOrBuilderList() 
  
    
public   List <?   extends   Condition . TimeRangeOrBuilder >  getActiveTimeRangeOrBuilderList ()  
   
   Range of time(s) specifying when Condition is active.
 Condition true if any time range matches.
 repeated .google.cloud.retail.v2.Condition.TimeRange active_time_range = 3;
 
  Returns 
  
    
      
        Type  
        Description  
       
      
        List <? extends com.google.cloud.retail.v2.Condition.TimeRangeOrBuilder > 
         
       
     
  
   
  getDefaultInstanceForType() 
  
    
public   Condition   getDefaultInstanceForType ()  
   
  Returns 
  
   
  getParserForType() 
  
    
public   Parser<Condition>   getParserForType ()  
   
  Returns 
  
  Overrides 
  
   
  getQueryTerms(int index) 
  
    
public   Condition . QueryTerm   getQueryTerms ( int   index )  
   
   A list (up to 10 entries) of terms to match the query on. If not
 specified, match all queries.
 If many query terms are specified, the condition
 is matched if any of the terms is a match (i.e. using the OR operator).
 repeated .google.cloud.retail.v2.Condition.QueryTerm query_terms = 1;
 
  Parameter 
  
    
      
        Name  
        Description  
       
      
        index  
        int  
       
     
  
  Returns 
  
   
  getQueryTermsCount() 
  
    
public   int   getQueryTermsCount ()  
   
   A list (up to 10 entries) of terms to match the query on. If not
 specified, match all queries.
 If many query terms are specified, the condition
 is matched if any of the terms is a match (i.e. using the OR operator).
 repeated .google.cloud.retail.v2.Condition.QueryTerm query_terms = 1;
 
  Returns 
  
   
  getQueryTermsList() 
  
    
public   List<Condition . QueryTerm >  getQueryTermsList ()  
   
   A list (up to 10 entries) of terms to match the query on. If not
 specified, match all queries.
 If many query terms are specified, the condition
 is matched if any of the terms is a match (i.e. using the OR operator).
 repeated .google.cloud.retail.v2.Condition.QueryTerm query_terms = 1;
 
  Returns 
  
   
  getQueryTermsOrBuilder(int index) 
  
    
public   Condition . QueryTermOrBuilder   getQueryTermsOrBuilder ( int   index )  
   
   A list (up to 10 entries) of terms to match the query on. If not
 specified, match all queries.
 If many query terms are specified, the condition
 is matched if any of the terms is a match (i.e. using the OR operator).
 repeated .google.cloud.retail.v2.Condition.QueryTerm query_terms = 1;
 
  Parameter 
  
    
      
        Name  
        Description  
       
      
        index  
        int  
       
     
  
  Returns 
  
   
  getQueryTermsOrBuilderList() 
  
    
public   List <?   extends   Condition . QueryTermOrBuilder >  getQueryTermsOrBuilderList ()  
   
   A list (up to 10 entries) of terms to match the query on. If not
 specified, match all queries.
 If many query terms are specified, the condition
 is matched if any of the terms is a match (i.e. using the OR operator).
 repeated .google.cloud.retail.v2.Condition.QueryTerm query_terms = 1;
 
  Returns 
  
    
      
        Type  
        Description  
       
      
        List <? extends com.google.cloud.retail.v2.Condition.QueryTermOrBuilder > 
         
       
     
  
   
  getSerializedSize() 
  
    
public   int   getSerializedSize ()  
   
  Returns 
  
  Overrides 
  
   
  getUnknownFields() 
  
    
public   final   UnknownFieldSet   getUnknownFields ()  
   
  Returns 
  
  Overrides 
  
   
  hashCode() 
  
  Returns 
  
  Overrides 
  
   
  internalGetFieldAccessorTable() 
  
    
protected   GeneratedMessageV3 . FieldAccessorTable   internalGetFieldAccessorTable ()  
   
  Returns 
  
  Overrides 
  
   
  isInitialized() 
  
    
public   final   boolean   isInitialized ()  
   
  Returns 
  
  Overrides 
  
   
  newBuilderForType() 
  
    
public   Condition . Builder   newBuilderForType ()  
   
  Returns 
  
   
  newBuilderForType(GeneratedMessageV3.BuilderParent parent) 
  
    
protected   Condition . Builder   newBuilderForType ( GeneratedMessageV3 . BuilderParent   parent )  
   
  Parameter 
  
  Returns 
  
  Overrides 
  
   
  newInstance(GeneratedMessageV3.UnusedPrivateParameter unused) 
  
    
protected   Object   newInstance ( GeneratedMessageV3 . UnusedPrivateParameter   unused )  
   
  Parameter 
  
  Returns 
  
  Overrides 
  
   
  toBuilder() 
  
    
public   Condition . Builder   toBuilder ()  
   
  Returns 
  
   
  writeTo(CodedOutputStream output) 
  
    
public   void   writeTo ( CodedOutputStream   output )  
   
  Parameter 
  
  Overrides 
  
  Exceptions 
  
 
     
    
  
  
  
     
  
 
  
    
    
      
       
    
    
  
  
 
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-10-30 UTC.
 
 
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-30 UTC."],[],[]]