Class GetCustomContentItemRequest<C extends ContentItem>


public class GetCustomContentItemRequest<C extends ContentItem> extends ContentAssetRequest<GetCustomContentItemRequest,C>
Request class used to request a single content item based on a specified id, ane will parse the custom fields into a class with annotated fields. For example, you could define a custom model that extends from ContentItem and annotate each field with the custom field value. The type of the field should match the content item type. Here is an example of a custom class with annotated fields:
   
     {@literal @}CustomContentType("content_type")
     public class CustomContentItem extends ContentItem {

         {@literal @}CustomContentField("text-field")
         String text;

         {@literal @}CustomContentField("date-field")
         ContentFieldDate dateField;

         {@literal @}CustomContentField("decimal-field")
         ContentFieldDecimal decimalField;
        }
 
Each field in the custom class should be either a String value or a ContentField type that extends from ContentField. Then you can reference the class as shown in the example below to get the item and populate the custom class model.
   

 // make call to get the item by id with the custom class
  GetCustomContentItemRequest request =
        new GetCustomContentItemRequest(clientAPI, CustomContentItem.class, itemID);

 // synchronous call to fetch the item
  ContentResponse<CustomContentItem> response = request.fetch();

 if (response.isSuccess()) {
     // custom content item from result
     CustomContentItem item = response.getResult();
 }