{"id":69023,"date":"2024-12-27T22:01:41","date_gmt":"2024-12-27T16:31:41","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=69023"},"modified":"2024-12-29T17:15:08","modified_gmt":"2024-12-29T11:45:08","slug":"understanding-annotations-basics-and-custom-solutions-in-java-kotlin-part-2","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/understanding-annotations-basics-and-custom-solutions-in-java-kotlin-part-2\/","title":{"rendered":"Part 2 | Understanding Annotations: Basics and Custom Solutions in Java\/Kotlin"},"content":{"rendered":"<p><strong>In <a href=\"https:\/\/www.tothenew.com\/blog\/understanding-annotations-basics-and-custom-solutions-in-java-kotlin\/\">Part 1<\/a><\/strong>, we discussed the fundamentals of annotations in Java and Kotlin, including an overview of what annotations are, the various types of built-in annotations like <span style=\"color: #339966;\">@Override<\/span>, <span style=\"color: #339966;\">@Deprecated,<\/span> etc., and how they simplify common programming tasks. We also explored the basic structure of annotations, how to define them, and the importance of using them effectively in your code.<\/p>\n<p>If you haven\u2019t checked out Part 1 yet, please do so first to get a strong foundation on annotations before moving into more advanced concepts like <strong>Retention Policies, Annotation<\/strong><strong>\u00a0Targets &amp;\u00a0<\/strong> <strong>Custom Annotation Solutions <\/strong>discussed here in Part 2.<\/p>\n<h3>Annotation Retention Policies<\/h3>\n<p>As we have covered the basics and types of annotations, let&#8217;s now delve deeper into Retention Policies, which play a critical role in annotations in both Java and Kotlin. Retention policies determine how long an annotation&#8217;s metadata is retained and where it is accessible during the application&#8217;s lifecycle. This choice is essential because it impacts how annotations are used and processed and can ensure that they serve their intended purpose without introducing unnecessary overhead in your application.<\/p>\n<p>There are three types of retention policies: <em>SOURCE<\/em>, <em>CLASS<\/em>, and <em>RUNTIME<\/em>.<\/p>\n<ul>\n<li><strong>RetentionPolicy.SOURCE or AnnotationRetention.SOURCE (Kotlin)<br \/>\nRetention Scope: <\/strong>Annotations are discarded after the code is compiled and are not included in the compiled .class files.<strong><br \/>\nPurpose: <\/strong>Used primarily for compile-time checks and code generation. These annotations are invisible at runtime.<strong><br \/>\nExample Use Case: <\/strong><span style=\"color: #339966;\">@Override<\/span> ensures a method overrides a superclass method, but it\u2019s not needed beyond compilation.<\/li>\n<\/ul>\n<pre>@Retention(RetentionPolicy.SOURCE)\r\npublic @interface ExampleSourceAnnotation { }<\/pre>\n<ul>\n<li><strong>RetentionPolicy.CLASS or In Kotlin AnnotationRetention.BINARY<br \/>\nRetention Scope:<\/strong> Annotations are included in the .class files but are not retained in memory at runtime.<br \/>\n<strong>Purpose:<\/strong> Useful for bytecode-level processing or tools that manipulate .class files, such as obfuscators or certain static analysis tools.<br \/>\nDefault Retention in Java: If no retention policy is specified, annotations default to CLASS.<br \/>\n<strong>Example Use Case:<\/strong> Annotations used during compilation that don\u2019t need runtime processing.<\/li>\n<\/ul>\n<pre>@Retention(RetentionPolicy.CLASS)\r\n\r\npublic @interface ExampleClassAnnotation { }<\/pre>\n<ul>\n<li><strong>RetentionPolicy.RUNTIME AnnotationRetention.RUNTIME (Kotlin)<\/strong><br \/>\n<strong>Retention Scope<\/strong>: Annotations are included in the .class files and are retained in memory at runtime, making them accessible via reflection.<br \/>\n<strong>Purpose<\/strong>: These annotations are essential for frameworks and libraries that rely on runtime metadata, such as dependency injection or ORM frameworks.<br \/>\n<strong>Example Use Case<\/strong>: Annotations like <span style=\"color: #339966;\">@Entity<\/span> in Hibernate or<span style=\"color: #339966;\"> @GET<\/span> in Retrofit, which require runtime processing.<\/li>\n<\/ul>\n<pre>@Retention(RetentionPolicy.RUNTIME)\r\npublic @interface ExampleRuntimeAnnotation { }<\/pre>\n<h3>Why Does Retention Policy Matter?<\/h3>\n<p>Choosing the right retention policy is crucial for the efficient use of annotations in your project. Here&#8217;s a summary to help you decide which retention policy to use based on your needs:<\/p>\n<ul>\n<li><strong>SOURCE<\/strong>: Use this when the annotation is only for compile-time checks or code generation. The annotation will not impact runtime behavior.<\/li>\n<li><strong>CLASS<\/strong>: Choose this when the annotation needs to be included in the bytecode for tools that manipulate .class files but is not required at runtime.<\/li>\n<li><strong>RUNTIME<\/strong>: This should be used when the annotation affects runtime behavior or needs to be accessible via reflection. It\u2019s ideal for frameworks that perform dependency injection, serialization, and other runtime tasks.<\/li>\n<\/ul>\n<p>By understanding and applying the correct retention policy, you can make sure your annotations are both effective and efficient, ensuring they fulfill their intended roles without causing unnecessary overhead.<\/p>\n<h3>Annotation Targets<\/h3>\n<p>Now that we&#8217;ve covered how long annotations stick around with retention policies, let&#8217;s talk about where we can apply them. This is where annotation targets come into play. Annotation targets define the specific elements in your code where an annotation can be used. Think of it like putting a sticker \u2014 you can place it on a book, a page, or maybe just on a specific word. Annotation targets specify exactly where the annotation is allowed to go.<\/p>\n<p>In both Java and Kotlin, you can control the placement of annotations by specifying the appropriate target. These targets are defined using the <span style=\"color: #339966;\">@Target<\/span> meta-annotation.<\/p>\n<p>Here are some common targets you\u2019ll encounter:<\/p>\n<div id=\"attachment_68951\" style=\"width: 850px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-68951\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-68951\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-04-123955.png\" alt=\"Annotation Target\" width=\"840\" height=\"238\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-04-123955.png 1489w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-04-123955-300x85.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-04-123955-1024x290.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-04-123955-768x218.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-04-123955-624x177.png 624w\" sizes=\"(max-width: 840px) 100vw, 840px\" \/><p id=\"caption-attachment-68951\" class=\"wp-caption-text\">Annotation Target<\/p><\/div>\n<p>When an annotation is created without specifying targets using the <span style=\"color: #339966;\">@Target<\/span> meta-annotation, it can be applied to almost any element in the code. This includes classes, methods, fields, constructors, parameters, and more.<\/p>\n<p><strong>General Syntax<\/strong><br \/>\nIn Java, targets are defined using the <span style=\"color: #339966;\">@Target<\/span> meta-annotation and constants from ElementType<\/p>\n<pre>import java.lang.annotation.ElementType;\r\nimport java.lang.annotation.Target;\r\n\r\n@Target({ElementType.TYPE, ElementType.METHOD})\r\npublic @interface ExampleAnnotation { }<\/pre>\n<p>In Kotlin, targets are defined using the <span style=\"color: #339966;\">@Target<\/span> meta-annotation with constants from Annotation Target.<\/p>\n<pre>@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)\r\nannotation class ExampleAnnotation<\/pre>\n<blockquote><p>If you apply an annotation to an element that is not allowed by the @Target specification: The compiler will raise an error like: <span style=\"color: #ff0000;\">annotation type not applicable to this kind of declaration<\/span><\/p><\/blockquote>\n<h4>Why Define Targets Explicitly?<\/h4>\n<p><strong>Clarity<\/strong>: Explicit targets make the intended use of an annotation clear to developers, reducing the risk of misuse.<br \/>\n<strong>Maintainability<\/strong>: Restricting where an annotation can be applied helps avoid confusion when the project grows or involves multiple contributors.<\/p>\n<p><strong>Best Practices<\/strong><br \/>\n<strong>Define Targets Explicitly<\/strong>: Always specify <span style=\"color: #339966;\">@Target<\/span> to prevent accidental misuse.<br \/>\n<strong>Use Meta-Annotations<\/strong>: Combine <span style=\"color: #339966;\">@Target<\/span> with <span style=\"color: #339966;\">@Retention<\/span> to control the lifecycle and scope of your annotation.<\/p>\n<hr \/>\n<h3>Creating Custom Annotations<\/h3>\n<p>Creating custom annotations in Java and Kotlin allows you to define the metadata that can be used to influence the behavior of your code. Custom annotations are useful for implementing cross-cutting concerns like logging, validation, or even custom behaviors in frameworks. A custom annotation is a user-defined annotation that can be applied to classes, methods, fields, or other elements to provide metadata that can be used by the compiler or runtime. Just like built-in annotations (@Override, @Deprecated), you can create your own annotations with specific properties, retention policies, and targets.<\/p>\n<h3>Key Steps for Creating Custom Annotations:<\/h3>\n<ul>\n<li><strong>Define the Annotation: <\/strong>Use <span style=\"color: #339966;\">@interface<\/span> in Java or annotation class in Kotlin. Specify metadata such as retention policy and targets using <span style=\"color: #339966;\">@Retention<\/span> and <span style=\"color: #339966;\">@Target<\/span>.<\/li>\n<li><strong>Add Elements: <\/strong>Define elements (similar to methods) within the annotation interface to store values. Provide default values for elements, if needed.<\/li>\n<li><strong>Process the Annotation: <\/strong>Write annotation processors to handle your custom annotation, either at compile time (using tools like APT) or runtime (via reflection)<strong>.<\/strong><\/li>\n<li><strong>Apply the Annotation: <\/strong>Annotate classes, methods, or fields with your custom annotation.<\/li>\n<\/ul>\n<h2>Example 1: Custom Annotation for View Binding <span style=\"color: #339966;\">@BindView<\/span><\/h2>\n<p>Let\u2019s take an example where we create a custom annotation similar to <em>ButterKnife&#8217;s<\/em> <span style=\"color: #339966;\">@BindView<\/span>, which simplifies view binding.<\/p>\n<p><strong>Purpose:<\/strong><\/p>\n<ul>\n<li><strong>Simplifies view binding:<\/strong> This annotation will reduce the need to write boilerplate <em>findViewById<\/em> calls.<\/li>\n<li><strong>Usage Scenario: <\/strong>Reduce Boilerplate Code: Instead of manually calling <em>findViewById()<\/em> every time, use <span style=\"color: #339966;\">@BindView<\/span> to annotate your fields. The utility method will automatically handle the binding.<\/li>\n<li><strong>Retention Policy: <\/strong><span style=\"color: #339966;\">@Retention(RetentionPolicy.RUNTIME)<\/span> Keeps the annotation at runtime so it can be accessed via reflection.<\/li>\n<li><strong>Target: <\/strong><span style=\"color: #339966;\">@Target(ElementType.FIELD) <\/span>\u00a0will be applied to fields where views are being bound<\/li>\n<\/ul>\n<p><strong>Step 1: Define the <span style=\"color: #339966;\">@BindView<\/span> Annotation in Java<\/strong><\/p>\n<div id=\"attachment_69031\" style=\"width: 730px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-69031\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-69031\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-160909.png\" alt=\"Define the @BindView Annotation\" width=\"720\" height=\"264\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-160909.png 755w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-160909-300x110.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-160909-624x229.png 624w\" sizes=\"(max-width: 720px) 100vw, 720px\" \/><p id=\"caption-attachment-69031\" class=\"wp-caption-text\">Define the @BindView Annotation<\/p><\/div>\n<p><strong>Step 2: Implement the Bind Method by Processing It<br \/>\n<\/strong>Here\u2019s a method that processes the <span style=\"color: #339966;\">@BindView<\/span> annotation and binds the views<\/p>\n<div id=\"attachment_69032\" style=\"width: 721px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-69032\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-69032\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-161050.png\" alt=\"Implement the Bind Method\" width=\"711\" height=\"463\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-161050.png 1295w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-161050-300x195.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-161050-1024x667.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-161050-768x500.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-161050-624x406.png 624w\" sizes=\"(max-width: 711px) 100vw, 711px\" \/><p id=\"caption-attachment-69032\" class=\"wp-caption-text\">Implement the Bind Method<\/p><\/div>\n<p>&nbsp;<\/p>\n<p><strong>Step 3: <\/strong>In your Activity, you can now use the custom @BindView annotation to bind views:<\/p>\n<div id=\"attachment_69033\" style=\"width: 720px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-69033\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-69033\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-161414.png\" alt=\"Apply the Annotation\" width=\"710\" height=\"640\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-161414.png 818w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-161414-300x270.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-161414-768x692.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-161414-624x562.png 624w\" sizes=\"(max-width: 710px) 100vw, 710px\" \/><p id=\"caption-attachment-69033\" class=\"wp-caption-text\">Apply the Annotation<\/p><\/div>\n<h3>Advantages of Using Custom Annotations<\/h3>\n<ul>\n<li><strong>Reduces Boilerplate Code: <\/strong>Writing <em>findViewById()<\/em> for every view can clutter your code. Annotations like <span style=\"color: #339966;\">@BindView<\/span> reduce the number of lines significantly.<\/li>\n<li><strong>Cleaner Code: <\/strong>Using annotations keeps the code clean by making the UI binding logic implicit. This improves readability and maintainability.<\/li>\n<li><strong>Reusable Utility: <\/strong>Once you\u2019ve written a utility method (like bind()), it can be reused across multiple activities or fragments without additional effort.<\/li>\n<\/ul>\n<p>Let\u2019s take another example to demonstrate integrating custom annotations into frameworks.<\/p>\n<h2>Example 2: Creating a Simple Dependency Injection Framework<\/h2>\n<p><strong>Purpose: <\/strong>We\u2019ll create a basic custom annotation, <span style=\"color: #339966;\">@Inject<\/span> to demonstrate how frameworks like Dagger handle dependency injection.<\/p>\n<p><strong>1. Defining the <span style=\"color: #339966;\">@Inject<\/span> Annotation<\/strong><\/p>\n<div id=\"attachment_69026\" style=\"width: 797px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-69026\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-69026\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155102.png\" alt=\"Defining the @Inject Annotation\" width=\"787\" height=\"349\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155102.png 893w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155102-300x133.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155102-768x341.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155102-624x277.png 624w\" sizes=\"(max-width: 787px) 100vw, 787px\" \/><p id=\"caption-attachment-69026\" class=\"wp-caption-text\">Defining the @Inject Annotation<\/p><\/div>\n<p>&nbsp;<\/p>\n<p><strong>2. Setting Up a Simple Service <\/strong>Let\u2019s define a service that we want to inject into a client class<\/p>\n<div id=\"attachment_69027\" style=\"width: 631px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-69027\" decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-69027\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155258.png\" alt=\"Setting Up a Simple Service\" width=\"621\" height=\"284\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155258.png 621w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155258-300x137.png 300w\" sizes=\"(max-width: 621px) 100vw, 621px\" \/><p id=\"caption-attachment-69027\" class=\"wp-caption-text\">Setting Up a Simple Service<\/p><\/div>\n<p>&nbsp;<\/p>\n<p><strong>3. Using <span style=\"color: #339966;\">@Inject<\/span> in an Activity <\/strong>Here\u2019s how you can use the @Inject annotation to mark a field in an Activity<\/p>\n<div id=\"attachment_69028\" style=\"width: 663px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-69028\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-69028\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155547.png\" alt=\"Using @Inject in an Activity\" width=\"653\" height=\"589\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155547.png 834w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155547-300x271.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155547-768x692.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155547-624x563.png 624w\" sizes=\"(max-width: 653px) 100vw, 653px\" \/><p id=\"caption-attachment-69028\" class=\"wp-caption-text\">Using @Inject in an Activity<\/p><\/div>\n<p><strong>4. Writing the Dependency Injection Processor <\/strong>The Injector class scans fields of the given object (in this case, the MainActivity) and injects dependencies for fields annotated with <span style=\"color: #339966;\">@Inject<br \/>\n<\/span><\/p>\n<div id=\"attachment_69030\" style=\"width: 769px\" class=\"wp-caption aligncenter\"><img aria-describedby=\"caption-attachment-69030\" decoding=\"async\" loading=\"lazy\" class=\" wp-image-69030\" src=\"https:\/\/www.tothenew.com\/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155741.png\" alt=\"Writing the Dependency Injection Processor\" width=\"759\" height=\"372\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155741.png 1604w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155741-300x147.png 300w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155741-1024x501.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155741-768x376.png 768w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155741-1536x752.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2024\/12\/Screenshot-2024-12-17-155741-624x305.png 624w\" sizes=\"(max-width: 759px) 100vw, 759px\" \/><p id=\"caption-attachment-69030\" class=\"wp-caption-text\">Writing the Dependency Injection Processor<\/p><\/div>\n<h3><strong>Advantages of Using <span style=\"color: #339966;\">@Inject<\/span> Custom Annotations in Android<\/strong><\/h3>\n<ul>\n<li><strong>Eliminates Boilerplate Code: <\/strong>The <span style=\"color: #339966;\">@Inject<\/span> annotation removes the need for manual initialization of fields.<\/li>\n<li><strong>Improves Readability: <\/strong>Annotated fields clearly indicate their purpose and reduce clutter in the <em>onCreate()<\/em> or initialization code.<\/li>\n<li><strong>Scales Well: <\/strong>As the app grows, dependency injection ensures better modularity and testability.<\/li>\n<li><strong>Framework Compatibility: <\/strong>This approach can be extended and refined to implement advanced DI patterns, such as those used in Dagger or Hilt.<\/li>\n<\/ul>\n<blockquote><p><strong>Keep Learning! Keep Coding!<\/strong><br \/>\nCustom annotations offer a lot of flexibility in your development process. Follow along as we dive deeper into annotation processing and more advanced use cases in the future!<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>In Part 1, we discussed the fundamentals of annotations in Java and Kotlin, including an overview of what annotations are, the various types of built-in annotations like @Override, @Deprecated, etc., and how they simplify common programming tasks. We also explored the basic structure of annotations, how to define them, and the importance of using them [&hellip;]<\/p>\n","protected":false},"author":1775,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":74},"categories":[518],"tags":[6379,6924,350,6920,6921,6923,6913,6918,6914,6919,6915,6916,6922,6917,5536],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/69023"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1775"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=69023"}],"version-history":[{"count":12,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/69023\/revisions"}],"predecessor-version":[{"id":69223,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/69023\/revisions\/69223"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=69023"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=69023"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=69023"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}