question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can this work with getter/setter?

See original GitHub issue

Hi! 😃

I was wondering, can this mapper work by mapping public attributes to their appropriate setter or getter (depending on the map direction).

Consider this example

class User {
  private _firstname: string;
  public set firstname(value: string) { this._firstname = value; }
  public get firstname(value: string) { return this._firstname; }
}

class UserVm {
  @AutoMap()
  public firstname: string;
}

My questoini is how to get a bi-directional map between User and UserVm? Hopefully not by manually assigning every public property to a setter/getter 😃

Thanks!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
krukrucommented, Jan 27, 2020

Hey @nartc After updating to the latest version (3.1.0) the issue is resolved and everything works like a charm 😃 Thanks!

0reactions
nartccommented, Jan 23, 2020

Check the latest version (3.0.5) and let me know if you still have issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getter and Setter in Java - GeeksforGeeks
Getters and setters let you manage how crucial variables in your code are accessed and altered. It can be seen in the program...
Read more >
Getters and Setters in Java Explained - freeCodeCamp
The getter method returns the value of the attribute. The setter method takes a parameter and assigns it to the attribute. Once the...
Read more >
@Getter and @Setter - Project Lombok
You can annotate a class with a @Getter or @Setter annotation. Doing so is equivalent to annotating all non-static fields in that class...
Read more >
Property getters and setters - The Modern JavaScript Tutorial
Getters/setters can be used as wrappers over “real” property values to gain more control over operations with them. For instance, if we want...
Read more >
Significance of Getters and Setters in Java - Baeldung
Getters and Setters play an important role in retrieving and updating the value of a variable outside the encapsulating class.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found